{"openapi":"3.1.0","info":{"title":"PaperTotal client API","version":"1.0.0","description":"The whole PaperTotal client API: every route the web app and the iOS and Android apps call. The public developer reference, /v1/openapi.json, is the part of this that a key or a token can reach.\n\nSign in with Firebase Authentication and send the ID token as `Authorization: Bearer <token>`. The first verified token creates the person, a personal workspace, the default categories and a trial, so GET /v1/me is also the first call after sign-up. There is no sign-up route. Refresh the token as Firebase says to: an expired one answers 401 UNAUTHENTICATED.\n\nEach operation's `security` lists every way in. `session` is that ID token. Where a route has a scope, `apiKey` and `oauth2` take a key or an access token holding it, and `x-required-scope` names it. No entry at all means the route takes no credential.\n\n`x-workspace-scoped` says a route runs inside one workspace. A session picks it with the X-Workspace-Id header, or lands on the person's default workspace. A key or a token is tied to one workspace and no header moves it. A workspace the caller is not in answers 404, not 403, and so does a record in another workspace. The X-Act-As header acts for someone who named the caller their delegate; it is listed only on the routes a delegate can reach.\n\n`x-requires-active-plan` means the route changes data, so a lapsed plan answers 402 SUBSCRIPTION_REQUIRED. Reading and exporting never stop. `x-required-permission` is what the caller's role must grant, or it answers 403. `x-required-feature` is what the workspace's plan must include, or it answers 402 PLAN_FEATURE_REQUIRED with `details.feature` and `details.plan`. `x-full-access-only` means a delegate on limited access is refused.\n\nSending a file. Ask POST /v1/uploads for a ticket, saying what the file is for (`purpose`), its type and its size in bytes. PUT exactly that many bytes to the ticket's `url`, with its `headers` and no others: the file goes straight to storage and never through this API. Then call the route the file is for with JSON naming `uploadId` where it would otherwise take a multipart `file`: POST /v1/documents or any other route that reads a document, such as POST /v1/documents/classify, POST /v1/parse or POST /v1/split, for document, POST /v1/expenses/{id}/receipts for expense_receipt, POST /v1/mileage/{id}/odometer-photos for odometer_photo, POST /v1/approvals/policy for policy_document, the statement imports under /v1/payment-accounts for statement, and POST /v1/attachments for attachment. Nothing counts until that route has checked the stored file: its bytes decide its type, and a file that is not acceptable is refused there and deleted. The ticket stops working at `expiresAt`, and a failed PUT is treated as an expired one: ask for a new ticket and try once more. A multipart `file` on the same routes still works, and is the simple way for a script.\n\nLists answer `{ data, nextCursor }`. Pass `nextCursor` back as `cursor` until it is null. A route with an Idempotency-Key parameter is safe to retry with the same key. Signed links to files last 15 minutes, so fetch them when they are needed and do not store them.\n\nMoney is an integer in minor units with a currency code, dates are YYYY-MM-DD, and every error has the same body with a stable code and a message written for a person. `code` is one of: BAD_REQUEST (400), VALIDATION_FAILED (422), UNAUTHENTICATED (401), FORBIDDEN (403), NOT_FOUND (404), CONFLICT (409), INVALID_STATE (409), PAYLOAD_TOO_LARGE (413), UNSUPPORTED_FILE (415), RATE_LIMITED (429), PLAN_LIMIT_REACHED (402), PLAN_FEATURE_REQUIRED (402), SUBSCRIPTION_REQUIRED (402), STORE_MANAGED (409), IDEMPOTENCY_CONFLICT (409), IDEMPOTENCY_IN_PROGRESS (409), FILE_TOO_SMALL (422), FILE_CORRUPTED (422), FILE_ENCRYPTED (422), IMAGE_TOO_SMALL (422), SANDBOX_LIMIT_REACHED (402), CLIENT_UPDATE_REQUIRED (426), UNAVAILABLE (503), NOT_CONFIGURED (503), UPSTREAM_ERROR (502), INTERNAL (500). Validation errors answer 422 with `details` as a list of `{ path, message }`. Some refusals also carry `details.reason` for a client to act on without reading the wording.\n\nSessions are limited to 600 requests a minute by address. Requests are limited per workspace, across all of its keys and tokens: 600 a minute on Business, 120 on Pro, 60 on Starter and 30 with no plan. Past that the API answers 429 with code RATE_LIMITED and a Retry-After header. OAuth access tokens last 30 minutes, and /oauth/token swaps a refresh token for a new pair."},"servers":[{"url":"https://api.papertotal.com"}],"security":[{"session":[]}],"tags":[{"name":"agent-rules"},{"name":"agents"},{"name":"analytics"},{"name":"api-calls"},{"name":"api-keys"},{"name":"approval-workflows"},{"name":"approvals"},{"name":"assistant"},{"name":"attachments"},{"name":"audit"},{"name":"auth"},{"name":"automation-rules"},{"name":"bank-statements"},{"name":"bank-statements-set"},{"name":"billing"},{"name":"blueprints"},{"name":"budgets"},{"name":"business-cards"},{"name":"card-layouts"},{"name":"catalog-imports"},{"name":"categories"},{"name":"chat"},{"name":"check-with-document"},{"name":"checks"},{"name":"clients"},{"name":"contacts"},{"name":"custom-fields"},{"name":"delegations"},{"name":"devices"},{"name":"document-settings"},{"name":"document-shares"},{"name":"documents"},{"name":"documents-set"},{"name":"domains"},{"name":"email"},{"name":"expenses"},{"name":"export-history"},{"name":"export-templates"},{"name":"exports"},{"name":"folders"},{"name":"forwarding"},{"name":"fraud"},{"name":"home"},{"name":"inbox"},{"name":"integrations"},{"name":"invitations"},{"name":"invoices"},{"name":"join"},{"name":"join-links"},{"name":"join-requests"},{"name":"mail-in"},{"name":"mcp"},{"name":"me"},{"name":"members"},{"name":"merchants"},{"name":"mileage"},{"name":"mileage-rates"},{"name":"notification-preferences"},{"name":"notifications"},{"name":"oauth"},{"name":"parse"},{"name":"parse-set"},{"name":"payment-accounts"},{"name":"people-sync"},{"name":"per-diem"},{"name":"per-diem-rates"},{"name":"personal-rules"},{"name":"plaid"},{"name":"policies"},{"name":"profile"},{"name":"projects"},{"name":"public"},{"name":"public-receipts"},{"name":"reference"},{"name":"reimbursements"},{"name":"release-notifications"},{"name":"release-subscriptions"},{"name":"report-catalog"},{"name":"report-fields"},{"name":"reports"},{"name":"rooms"},{"name":"sandbox"},{"name":"saved-searches"},{"name":"scheduled-reports"},{"name":"scim-tokens"},{"name":"search"},{"name":"split"},{"name":"split-and-classify"},{"name":"sso"},{"name":"status"},{"name":"tags"},{"name":"tasks"},{"name":"tax"},{"name":"time"},{"name":"tls-certificates"},{"name":"transactions"},{"name":"travel"},{"name":"uploads"},{"name":"usage"},{"name":"vehicles"},{"name":"w-8ben-e"},{"name":"w2s"},{"name":"w2s-set"},{"name":"w9s"},{"name":"webhooks"},{"name":"well-known"},{"name":"workflow-approvals"},{"name":"workflows"},{"name":"workspace"},{"name":"workspaces"}],"paths":{"/.well-known/oauth-authorization-server":{"get":{"operationId":"OAuth_authorizationServer","tags":["well-known"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Read the authorization server metadata","description":"RFC 8414.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthServerMetadata"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/.well-known/oauth-protected-resource/mcp":{"get":{"operationId":"OAuth_mcpResource","tags":["well-known"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Read how to get a token for the MCP server","description":"RFC 9728, at the path of the MCP endpoint.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthProtectedResource"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/.well-known/oauth-protected-resource/v1":{"get":{"operationId":"OAuth_apiResource","tags":["well-known"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Read how to get a token for the API","description":"RFC 9728.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthProtectedResource"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/mcp":{"post":{"operationId":"Mcp_handle","tags":["mcp"],"security":[{"oauth2":["mcp:tools"]}],"x-required-scope":"mcp:tools","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Call the MCP server","description":"One JSON-RPC 2.0 message in each request. Only an OAuth token issued for this server gets in, never a key or a session, and it is held to one workspace and to what the person can do. A plain answer is JSON. Only subscriptions/listen answers with server-sent events.","parameters":[{"name":"MCP-Protocol-Version","in":"header","required":false,"description":"The revision in use, once initialize has settled one. It must match the version in the message.","schema":{"type":"string"}},{"name":"Mcp-Method","in":"header","required":false,"description":"The method, on the current revision: the same value as in the message.","schema":{"type":"string"}},{"name":"Mcp-Name","in":"header","required":false,"description":"The tool or resource named in the message, on the current revision.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpRequest"},"example":{"jsonrpc":"2.0","method":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpResponse"}},"text/event-stream":{"schema":{"type":"string","description":"Server-sent events. The data of each event is `x-event-schema`, as JSON."},"x-event-schema":{"$ref":"#/components/schemas/McpResponse"}}}},"202":{"description":"A notification, which has no id, accepted with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"400":{"description":"Not one JSON-RPC message, or a protocol version this server does not have.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpResponse"}}}},"401":{"description":"No token, or one not issued for this server. WWW-Authenticate says where to get one.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks a scope the call needs, or the Origin is not one this server knows. A token without mcp:tools gets the usual error body.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpResponse"}}}},"404":{"description":"No such method, on the current protocol revision. Older revisions answer 200 with the same error.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpResponse"}}}},"429":{"description":"Too many requests. Retry-After says when to try again.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/oauth/authorize":{"get":{"operationId":"OAuth_authorize","tags":["oauth"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Start an authorization","description":"Open this in the person's browser. It never renders anything itself: it sends them to the consent screen in the web app, or back to redirect_uri with an error. A bad client or redirect cannot be sent back to anyone, so it stops here with an error instead.","parameters":[{"name":"response_type","in":"query","required":true,"schema":{"type":"string","const":"code"}},{"name":"client_id","in":"query","required":true,"schema":{"type":"string","description":"A registered client id, or the URL of a client metadata document."}},{"name":"redirect_uri","in":"query","required":true,"schema":{"type":"string","description":"Exactly as registered."}},{"name":"scope","in":"query","required":false,"schema":{"description":"Scopes separated by spaces. `all` asks for every API scope.","type":"string"}},{"name":"state","in":"query","required":false,"schema":{"description":"Comes back unchanged on the redirect.","type":"string"}},{"name":"code_challenge","in":"query","required":true,"schema":{"type":"string","description":"43 characters of base64url: the SHA-256 of the verifier."}},{"name":"code_challenge_method","in":"query","required":true,"schema":{"type":"string","const":"S256"}},{"name":"resource","in":"query","required":false,"schema":{"description":"The API or the MCP server. A token for one is refused at the other.","type":"string"}}],"responses":{"302":{"description":"To the consent screen, or back to redirect_uri with error, error_description and state.","headers":{"Location":{"description":"Where to go next.","schema":{"type":"string"}}}},"default":{"description":"Refused. These routes answer as the OAuth RFCs say, not with the usual error body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthProtocolError"}}}}}}},"/oauth/register":{"post":{"operationId":"OAuth_register","tags":["oauth"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Register an app dynamically","description":"Open to anyone, as RFC 7591 has it. A client nobody authorizes is deleted after a week.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClientMetadata"},"example":{"client_name":"string","redirect_uris":["string"]}}}},"responses":{"201":{"description":"Registered. Never cached.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthRegisteredClient"}}}},"default":{"description":"Refused. These routes answer as the OAuth RFCs say, not with the usual error body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthProtocolError"}}}}}}},"/oauth/revoke":{"post":{"operationId":"OAuth_revoke","tags":["oauth"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Revoke a token","description":"Takes a form, not JSON. Answers 200 for a token this client does not hold too, as RFC 7009 says.","parameters":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/OAuthRevokeForm"},"example":{"token":"string"}}}},"responses":{"200":{"description":"Revoked, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"description":"Refused. These routes answer as the OAuth RFCs say, not with the usual error body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthProtocolError"}}}}}}},"/oauth/token":{"post":{"operationId":"OAuth_token","tags":["oauth"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Exchange a code or a refresh token","description":"Takes a form, not JSON. A refresh token rotates: using an old one ends the whole family.","parameters":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/OAuthTokenForm"},"example":{"grant_type":"authorization_code"}}}},"responses":{"200":{"description":"A new pair. Never cached.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthToken"}}}},"default":{"description":"Refused. These routes answer as the OAuth RFCs say, not with the usual error body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthProtocolError"}}}}}}},"/v1/agent-rules":{"get":{"operationId":"AgentRules_list","tags":["agent-rules"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List agent rules","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRuleList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"AgentRules_create","tags":["agent-rules"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create an agent rule","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveAgentRuleInput"},"example":{"title":"string","prompt":"string","plan":{"events":["report.submitted"],"branches":[{"then":[{"tool":"post_to_thread"}]}]}}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRule"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/agent-rules/{id}":{"delete":{"operationId":"AgentRules_remove","tags":["agent-rules"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Delete an agent rule","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"AgentRules_update","tags":["agent-rules"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change an agent rule","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentRuleInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRule"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/agent-rules/describe":{"post":{"operationId":"AgentRules_describe","tags":["agent-rules"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Turn words into a rule to read over","description":"Saves nothing.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DescribeRuleInput"},"example":{"prompt":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRuleDescribed"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/agent-rules/suggestions":{"get":{"operationId":"AgentRules_suggestions","tags":["agent-rules"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List suggested agent rules","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestedAgentRuleList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/agents":{"get":{"operationId":"Agents_list","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List agents","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Agents_create","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create an agent","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/agents/{id}":{"delete":{"operationId":"Agents_remove","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete an agent","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Agents_get","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get an agent","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Agents_update","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change an agent","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgentInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/agents/{id}/activity":{"get":{"operationId":"Agents_activity","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List what an agent did","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentActivityList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/agents/{id}/inbox":{"get":{"operationId":"Agents_inbox","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See what an agent's own account holds","description":"The chats it is in, what waits on it to approve, and what it waits on its owner to confirm.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentInbox"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/agents/{id}/join":{"post":{"operationId":"Agents_join","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add an agent to a workspace","description":"The agent is found in this workspace. With no workspaceId it joins this workspace, and with one it joins that workspace instead, where you have to manage members too. It takes a seat there as a member, and joining again changes nothing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentJoinInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/agents/{id}/rules":{"post":{"operationId":"Agents_addRule","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Give an agent a rule","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveAgentRuleInput"},"example":{"title":"string","prompt":"string","plan":{"events":["report.submitted"],"branches":[{"then":[{"tool":"post_to_thread"}]}]}}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRule"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/agents/{id}/schedules":{"get":{"operationId":"Agents_schedules","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List an agent's schedules","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentScheduleList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Agents_createSchedule","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Schedule an agent","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentScheduleInput"},"example":{"title":"string","instruction":"string","cadence":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSchedule"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/agents/{id}/schedules/{scheduleId}":{"delete":{"operationId":"Agents_cancelSchedule","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Cancel an agent's schedule","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"scheduleId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Agents_updateSchedule","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change an agent's schedule","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"scheduleId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentScheduleInput"},"example":{"title":"string","instruction":"string","cadence":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSchedule"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/agents/bulk-delete":{"post":{"operationId":"Agents_bulkDelete","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete many agents","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteAgentsInput"},"example":{"ids":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentBulkDeleteResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/agents/draft":{"post":{"operationId":"Agents_draft","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Draft an agent from a description","description":"Saves nothing.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftAgentInput"},"example":{"message":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentDraft"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/agents/templates":{"get":{"operationId":"Agents_templates","tags":["agents"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List agent templates","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentTemplateList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/ask":{"post":{"operationId":"InsightsAsk_ask","tags":["analytics"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Ask a question about spending","description":"A question is a read, so it works on a lapsed plan.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskInsightsInput"},"example":{"question":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InsightAnswer"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/by-category":{"get":{"operationId":"Analytics_byCategory","tags":["analytics"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending by category","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Breakdown"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/by-department":{"get":{"operationId":"Analytics_byDepartment","tags":["analytics"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending by department","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Breakdown"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/by-member":{"get":{"operationId":"Analytics_byMember","tags":["analytics"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending by member","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Breakdown"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/by-merchant":{"get":{"operationId":"Analytics_byMerchant","tags":["analytics"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending by merchant","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Breakdown"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/by-project":{"get":{"operationId":"Analytics_byProject","tags":["analytics"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending by project","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Breakdown"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/by-tag":{"get":{"operationId":"Analytics_byTag","tags":["analytics"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending by tag","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Breakdown"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/summary":{"get":{"operationId":"Analytics_summary","tags":["analytics"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending totals for a period, with the period before it","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsSummary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/analytics/trend":{"get":{"operationId":"Analytics_trend","tags":["analytics"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Spending over time","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"interval","in":"query","required":false,"schema":{"default":"month","type":"string","enum":["day","week","month","quarter","year","running"]}},{"name":"groupCurrency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trend"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/api-calls":{"get":{"operationId":"ApiCalls_list","tags":["api-calls"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List the calls keys and apps made","description":"A credential cannot read what credentials did: this takes a person.","parameters":[{"name":"key","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","pattern":"^[1-5](?:[0-9]{2}|xx)$"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiCallPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/api-keys":{"get":{"operationId":"ApiKeys_list","tags":["api-keys"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List API keys","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ApiKeys_create","tags":["api-keys"],"security":[{"session":[]}],"x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create an API key","description":"The key is in this response and nowhere else.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreated"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/api-keys/{id}":{"delete":{"operationId":"ApiKeys_revoke","tags":["api-keys"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Revoke an API key","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"ApiKeys_get","tags":["api-keys"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get an API key","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"ApiKeys_update","tags":["api-keys"],"security":[{"session":[]}],"x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change an API key","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateApiKeyInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/api-keys/{id}/client-secret":{"post":{"operationId":"ApiKeys_issueClientSecret","tags":["api-keys"],"security":[{"session":[]}],"x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Issue a key's signing secret","description":"The secret is in this response and nowhere else.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyClientSecret"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/api-keys/{id}/rotate":{"post":{"operationId":"ApiKeys_rotate","tags":["api-keys"],"security":[{"session":[]}],"x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Replace an API key","description":"The new key is in this response and nowhere else.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreated"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/api-keys/available-permissions":{"get":{"operationId":"ApiKeys_permissions","tags":["api-keys"],"security":[{"session":[]}],"x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List the scopes a key can be given","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyPermissions"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/api-keys/verify":{"get":{"operationId":"ApiKeys_verify","tags":["api-keys"],"security":[{"session":[]},{"apiKey":["any_api_key"]}],"x-required-scope":"any_api_key","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See what the calling key grants","description":"Any key may call this about itself, whatever its scopes. It says what the key can reach, in which workspace, and until when. Every other route under /v1/api-keys takes a person, so a key cannot mint a stronger key.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyVerification"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/approval-workflows":{"get":{"operationId":"Workflows_list","tags":["approval-workflows"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List approval workflows","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalWorkflowList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Workflows_create","tags":["approval-workflows"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"approvals","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create an approval workflow","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalWorkflowInput"},"example":{"name":"string","steps":[{"level":1,"kind":"manager"}]}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalWorkflow"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/approval-workflows/{id}":{"delete":{"operationId":"Workflows_remove","tags":["approval-workflows"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"approvals","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete an approval workflow","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Workflows_update","tags":["approval-workflows"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"approvals","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change an approval workflow","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalWorkflowInput"},"example":{"name":"string","steps":[{"level":1,"kind":"manager"}]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalWorkflow"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/approval-workflows/export":{"get":{"operationId":"Workflows_export","tags":["approval-workflows"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Download approval workflows as CSV","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/approval-workflows/import":{"post":{"operationId":"Workflows_import","tags":["approval-workflows"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"multi_level_approvals","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import approval workflows from CSV","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportInput"},"example":{"csv":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/approvals":{"get":{"operationId":"Approvals_queue","tags":["approvals"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List the reports waiting on the caller","description":"With counts of what is pending, clean, flagged and delegated.","parameters":[{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","all"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalQueue"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/approvals/bulk-approve":{"post":{"operationId":"Approvals_bulkApprove","tags":["approvals"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Approve many reports","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkApproveInput"},"example":{"reportIds":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/approvals/policy":{"delete":{"operationId":"Approvals_removePolicy","tags":["approvals"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Remove the policy PDF","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Approvals_policy","tags":["approvals"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Read the expense policy","description":"Every member can read it. The link to the PDF is short-lived.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Approvals_uploadPolicy","tags":["approvals"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Upload the expense policy as a PDF","description":"Multipart with the PDF in a field named `file`, or JSON naming an `uploadId` from POST /v1/uploads.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}}},"application/json":{"schema":{"type":"object","required":["uploadId"],"properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."}}},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/approvals/settings":{"get":{"operationId":"Approvals_settings","tags":["approvals"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the report settings","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Approvals_updateSettings","tags":["approvals"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change the report settings","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportSettingsInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/assistant/actions/{id}/confirm":{"post":{"operationId":"Assistant_confirm","tags":["assistant"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Confirm what Concierge proposed","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingAction"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/assistant/actions/{id}/decline":{"post":{"operationId":"Assistant_decline","tags":["assistant"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Decline what Concierge proposed","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingAction"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/assistant/ask":{"post":{"operationId":"Assistant_ask","tags":["assistant"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Ask Concierge something","description":"Reading needs no confirmation. A change waits as a pending action until the person confirms it.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskAssistantInput"},"example":{"message":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantAsk"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/assistant/expenses/{id}/explain":{"get":{"operationId":"Assistant_explainExpense","tags":["assistant"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Explain how an expense was filed","description":"Where its category came from, and every decision Concierge made about it.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseExplanation"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/assistant/reports/{id}/explain":{"get":{"operationId":"Assistant_explainReport","tags":["assistant"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Explain how a report got where it is","description":"Each thing that happened to it, by whom and through what. No model is asked.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportExplain"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/assistant/room":{"post":{"operationId":"Assistant_room","tags":["assistant"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Open the caller's room with Concierge","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantRoom"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/assistant/runs/{id}":{"get":{"operationId":"Assistant_run","tags":["assistant"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Explain a Concierge run","description":"What it read and did, in order, and the facts it went on.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplainRun"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/assistant/status":{"get":{"operationId":"Assistant_status","tags":["assistant"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See whether Concierge is available","description":"Without a Claude key it says so, and everything else keeps working.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssistantStatus"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/attachments":{"post":{"operationId":"Attachments_create","tags":["attachments"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Make a file a comment or a message can carry","description":"From a finished upload with the purpose attachment. Name its id in attachmentIds on a comment or a message. A file nothing names is deleted after a week.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAttachmentInput"},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Attachment"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/audit":{"get":{"operationId":"Audit_list","tags":["audit"],"security":[{"session":[]}],"x-required-permission":"audit.read","x-required-feature":"audit_log","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List audit events","parameters":[{"name":"action","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"entityType","in":"query","required":false,"schema":{"type":"string","maxLength":60}},{"name":"entityId","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"actorId","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditEventPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/auth/discover":{"post":{"operationId":"SignInDiscovery_discover","tags":["auth"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Find out how an address signs in","description":"Needs no sign-in. Call it before showing a password box: an address on a domain with single sign-on goes to its identity provider.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoverSignInInput"},"example":{"email":"someone@example.com"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInDiscovery"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/auth/email-sign-in":{"post":{"operationId":"PublicAuth_emailSignIn","tags":["auth"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Send a sign-in link by email","description":"Answers 202 whether or not the address has an account, so an address cannot be probed.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSignInInput"},"example":{"email":"someone@example.com"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSignInSent"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/auth/email-sign-in/redeem":{"post":{"operationId":"PublicAuth_redeem","tags":["auth"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Finish signing in from an email link","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedeemEmailSignInInput"},"example":{"email":"someone@example.com","code":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSignInRedeemed"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/auth/recovery-code":{"post":{"operationId":"PublicAuth_recovery","tags":["auth"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Use a recovery code","description":"Needs no sign-in: this is for someone who lost their second factor.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UseRecoveryCodeInput"},"example":{"email":"someone@example.com","code":"string"}}}},"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules":{"get":{"operationId":"Automation_list","tags":["automation-rules"],"security":[{"session":[]},{"apiKey":["rules:read"]},{"oauth2":["rules:read"]}],"x-required-scope":"rules:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List automation rules","description":"The workspace's rules, top to bottom. The first rule to set a field wins it.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRuleList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Automation_create","tags":["automation-rules"],"security":[{"session":[]},{"apiKey":["rules:write"]},{"oauth2":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add an automation rule","description":"Conditions match on the expense, its line items, its tags and flags, the words on its document, or a question for Claude.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRuleInput"},"example":{"name":"string","conditions":[{"field":"merchantName","op":"equals"}],"actions":{}}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRule"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/{id}":{"delete":{"operationId":"Automation_remove","tags":["automation-rules"],"security":[{"session":[]},{"apiKey":["rules:write"]},{"oauth2":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete an automation rule","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Automation_update","tags":["automation-rules"],"security":[{"session":[]},{"apiKey":["rules:write"]},{"oauth2":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change an automation rule","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAutomationRuleInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRule"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/{id}/apply":{"post":{"operationId":"Automation_apply","tags":["automation-rules"],"security":[{"session":[]},{"apiKey":["rules:write"]},{"oauth2":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Run a rule over expenses not yet submitted","description":"A field a person set keeps their value. Running it twice changes nothing more.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationApply"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/{id}/test":{"post":{"operationId":"Automation_test","tags":["automation-rules"],"security":[{"session":[]},{"apiKey":["rules:write"]},{"oauth2":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Count what a saved rule would match","description":"Changes nothing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationPreview"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/export":{"get":{"operationId":"Automation_exportFile","tags":["automation-rules"],"security":[{"session":[]},{"apiKey":["rules:read"]},{"oauth2":["rules:read"]}],"x-required-scope":"rules:read","x-required-permission":"policies.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Export automation rules as a file","description":"Every workspace rule, in order, with names in place of ids, so another workspace can import it. Needs policies.manage.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulesDocument"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/import":{"post":{"operationId":"Automation_import","tags":["automation-rules"],"security":[{"session":[]},{"apiKey":["rules:write"]},{"oauth2":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import automation rules from CSV","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportInput"},"example":{"csv":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/import-file":{"post":{"operationId":"Automation_importFile","tags":["automation-rules"],"security":[{"session":[]},{"apiKey":["rules:write"]},{"oauth2":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import automation rules from a file","description":"Takes what the export route gives. Each name is looked up in this workspace, and a rule that names something it does not have comes back in errors, with the reason. A rule already here is skipped.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RulesDocument"},"example":{"format":"papertotal.rules","version":1,"rules":[{"name":"string","conditions":[{"field":"merchantName","op":"equals"}],"actions":{}}]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/preview":{"post":{"operationId":"Automation_preview","tags":["automation-rules"],"security":[{"session":[]},{"apiKey":["rules:write"]},{"oauth2":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Count what some conditions would match","description":"Changes nothing. The sample shows expenses, so it needs rules:write and policies.manage.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationPreviewInput"},"example":{"conditions":[{"field":"merchantName","op":"equals"}]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationPreview"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/automation-rules/reorder":{"post":{"operationId":"Automation_reorder","tags":["automation-rules"],"security":[{"session":[]},{"apiKey":["rules:write"]},{"oauth2":["rules:write"]}],"x-required-scope":"rules:write","x-required-permission":"policies.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Put the rules in a new order","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderAutomationRulesInput"},"example":{"ids":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRuleOrder"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/bank-statements":{"post":{"operationId":"SpecialDocuments_bankStatements","tags":["bank-statements"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a bank statement","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"202":{"description":"Accepted. The document is still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/bank-statements-set":{"get":{"operationId":"DocumentSets_listStatementSets","tags":["bank-statements-set"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List bank statement sets","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSetPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentSets_createStatementSet","tags":["bank-statements-set"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Split a PDF of bank statements and read each one","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Up to 250 pages and 50 MB. Answers at once. bank_statement_set.created says when every statement is read, and bank_statement_set.failed why not. Account numbers are masked in every view.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/bank-statements-set/{id}":{"get":{"operationId":"DocumentSets_getStatementSet","tags":["bank-statements-set"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a bank statement set","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/bank-statements/async":{"post":{"operationId":"SpecialDocuments_bankStatementsAsync","tags":["bank-statements"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a bank statement in the background","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/billing":{"get":{"operationId":"Billing_view","tags":["billing"],"security":[{"session":[]},{"apiKey":["billing:read"]},{"oauth2":["billing:read"]}],"x-required-scope":"billing:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the plan, seats and this month's usage","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/billing/cancel":{"post":{"operationId":"Billing_cancel","tags":["billing"],"security":[{"session":[]},{"apiKey":["billing:write"]},{"oauth2":["billing:write"]}],"x-required-scope":"billing:write","x-required-permission":"billing.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Cancel the subscription","description":"It ends when the period already paid for does, as cancelling in the billing portal does. Asking twice changes nothing. Needs billing.manage.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/billing/cashsdk/token":{"get":{"operationId":"Billing_cashsdkToken","tags":["billing"],"security":[{"session":[]}],"x-required-permission":"billing.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a CashSDK user token","description":"For the phone apps: send it as X-CashSDK-User-Token. Never cached.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashsdkToken"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/billing/checkout":{"post":{"operationId":"Billing_checkout","tags":["billing"],"security":[{"session":[]}],"x-required-permission":"billing.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Start a checkout","description":"Answers with a link. A workspace billed through a store answers 409 STORE_MANAGED.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"},"example":{"plan":"STARTER","interval":"MONTH"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingRedirect"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/billing/invoices":{"get":{"operationId":"Billing_invoices","tags":["billing"],"security":[{"session":[]},{"apiKey":["billing:read"]},{"oauth2":["billing:read"]}],"x-required-scope":"billing:read","x-required-permission":"billing.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List invoices","description":"Newest first, from Stripe, with Stripe's own links to each invoice's page and PDF. A plan bought in a store has its invoices there.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingInvoicePage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/billing/plans":{"get":{"operationId":"Billing_plans","tags":["billing"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List the plans and their prices","description":"Needs no sign-in. Every figure is also an App Store and Google Play price point.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingPlans"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/billing/portal":{"post":{"operationId":"Billing_portal","tags":["billing"],"security":[{"session":[]}],"x-required-permission":"billing.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Open the billing portal","description":"Answers with a link. A workspace billed through a store answers 409 STORE_MANAGED.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingRedirect"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/billing/restore":{"post":{"operationId":"Billing_restore","tags":["billing"],"security":[{"session":[]}],"x-required-permission":"billing.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Read store purchases again","description":"For a Restore purchases button: PaperTotal asks CashSDK again what this workspace holds.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/billing/seats":{"post":{"operationId":"Billing_seats","tags":["billing"],"security":[{"session":[]}],"x-required-permission":"billing.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Change the seats on the plan","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeatsRequest"},"example":{"seats":0}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/blueprints":{"get":{"operationId":"Blueprints_list","tags":["blueprints"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List blueprints","description":"This workspace's own, then the built-in catalogue.","parameters":[{"name":"documentType","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlueprintList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Blueprints_create","tags":["blueprints"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"settings.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a blueprint","description":"A strict subset of JSON schema: object, array, string, number, integer and boolean, nested up to four levels and up to 150 fields. A keyword outside it, such as $ref, pattern or anyOf, is refused by name. Needs settings.manage.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateBlueprintInput"},"example":{"name":"string","title":"string","schema":{"type":"object","properties":"string"}}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Blueprint"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/blueprints/{name}":{"delete":{"operationId":"Blueprints_remove","tags":["blueprints"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"settings.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a blueprint","description":"Results it made stay, and its name can be used again.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Blueprints_get","tags":["blueprints"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a blueprint","description":"Asks for an older version with version.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"version","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":9007199254740991}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Blueprint"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Blueprints_update","tags":["blueprints"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"settings.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a blueprint","description":"A new schema or new field guidance adds a version. Results keep the version that made them.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBlueprintInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Blueprint"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/blueprints/draft":{"post":{"operationId":"Blueprints_draft","tags":["blueprints"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"settings.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Propose a blueprint from a sample","description":"Multipart, or JSON naming an uploadId from POST /v1/uploads. Reads one sample and proposes fields. Nothing is saved until it is sent to POST /v1/blueprints. Costs one scan.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."}},"required":["uploadId"]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlueprintDraft"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/blueprints/draft/{documentId}":{"get":{"operationId":"Blueprints_readDraft","tags":["blueprints"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a proposed blueprint","description":"The document id from proposing one. Answers READING until it has been read.","parameters":[{"name":"documentId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlueprintDraft"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/budgets":{"get":{"operationId":"Budgets_list","tags":["budgets"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List budgets","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Budgets_create","tags":["budgets"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"policies","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a budget","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetInput"},"example":{"scope":"CATEGORY","targetId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Budget"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/budgets/{id}":{"delete":{"operationId":"Budgets_remove","tags":["budgets"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"policies","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a budget","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Budgets_get","tags":["budgets"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a budget and how it stands","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Budget"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Budgets_update","tags":["budgets"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"policies","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a budget","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateBudgetInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Budget"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/business-cards":{"post":{"operationId":"SpecialDocuments_businessCards","tags":["business-cards"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a business card","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"202":{"description":"Accepted. The document is still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/card-layouts":{"get":{"operationId":"CardLayouts_list","tags":["card-layouts"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List saved statement layouts","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardLayoutList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"CardLayouts_save","tags":["card-layouts"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Save a statement layout","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardLayoutInput"},"example":{"name":"string","mapping":{"date":"string","description":"string"}}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardLayout"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/card-layouts/{id}":{"delete":{"operationId":"CardLayouts_remove","tags":["card-layouts"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a statement layout","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/catalog-imports/spreadsheet":{"post":{"operationId":"CatalogImports_spreadsheet","tags":["catalog-imports"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a spreadsheet into CSV","description":"For a .xls or .xlsx file sent straight to storage. It is read once and gone, and the rows come back to send to an import route.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpreadsheetUpload"},"example":{"uploadId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpreadsheetText"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/categories":{"get":{"operationId":"Categories_list","tags":["categories"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List categories","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"enabled","in":"query","required":false,"schema":{"type":"string"}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["EXPENSE","COGS","INCOME","REFUND"]}},{"name":"origin","in":"query","required":false,"schema":{"type":"string","enum":["SYSTEM","CUSTOM","ACCOUNTING"]}},{"name":"headers","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Categories_create","tags":["categories"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a category","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/categories/{id}":{"delete":{"operationId":"Categories_remove","tags":["categories"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a category","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Categories_get","tags":["categories"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a category","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Categories_update","tags":["categories"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a category","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCategoryInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/categories/{id}/access":{"get":{"operationId":"Categories_access","tags":["categories"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See who has a category in their list","description":"Nobody listed means everyone does.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryAccess"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Categories_setAccess","tags":["categories"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Set who has a category in their list","description":"An empty list gives it back to everyone.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryAccessInput"},"example":{"userIds":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryAccess"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/categories/import":{"post":{"operationId":"Categories_import","tags":["categories"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import categories from CSV","description":"Send the CSV as text/plain, or as JSON with a `csv` field. Rows that match an existing category update it. Columns: Name, Enabled, GL code, Payroll code, Comment required, Comment hint, Max expense. With mode=replace the list becomes what the file says: a category it leaves out is deleted, or turned off if something uses it, and a file with a row it cannot read changes nothing.","parameters":[{"name":"mode","in":"query","required":false,"schema":{"type":"string","enum":["merge","replace"]}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportInput"},"example":{"csv":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/chat/flags":{"get":{"operationId":"Chat_flags","tags":["chat"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List flagged messages","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageFlagList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/chat/people":{"get":{"operationId":"Chat_people","tags":["chat"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Find people to talk to","parameters":[{"name":"q","in":"query","required":false,"schema":{"default":"","type":"string","maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatPersonList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/chat/preferences":{"post":{"operationId":"Chat_preferences","tags":["chat"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Change how the chat list is ordered","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatPreferenceInput"},"example":{"priorityMode":"MOST_RECENT"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatPreference"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/chat/restrictions":{"post":{"operationId":"Chat_restrict","tags":["chat"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Stop someone posting in chat","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestrictSenderInput"},"example":{"userId":"string"}}}},"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/chat/restrictions/{userId}":{"delete":{"operationId":"Chat_unrestrict","tags":["chat"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Let someone post in chat again","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/chat/stream":{"get":{"operationId":"Chat_stream","tags":["chat"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Follow chat as it happens","description":"Server-sent events, one `chat` event for each change. What comes down is ids, and no text but Concierge's words to the person asking: re-read through the other routes, which check access. The stream ends after a while, so reconnect with the last event id, and what was missed comes first. Polling `messages` keeps working when a stream cannot.","parameters":[{"name":"lastEventId","in":"query","required":false,"schema":{"description":"The same as the Last-Event-ID header.","type":"string"}},{"name":"Last-Event-ID","in":"header","required":false,"description":"The id of the last event this client received, sent again on reconnecting so the events missed since come first.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"A stream of server-sent events.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"text/event-stream":{"schema":{"type":"string","description":"Server-sent events. The data of each event is `x-event-schema`, as JSON."},"x-event-schema":{"$ref":"#/components/schemas/ChatEvent"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/chat/threads":{"get":{"operationId":"Chat_thread","tags":["chat"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Open the thread on a report or an expense","description":"Send `reportId` or `expenseId`.","parameters":[{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"expenseId","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/check-with-document":{"post":{"operationId":"SpecialDocuments_checkWithDocument","tags":["check-with-document"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a check with its remittance","description":"Two documents, read apart: the check, and what came with it.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckWithDocumentInput"},"example":{"check":{},"document":{}}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckWithDocument"}}}},"202":{"description":"Accepted. One or both are still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckWithDocument"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/checks":{"post":{"operationId":"SpecialDocuments_checks","tags":["checks"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a bank check","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"202":{"description":"Accepted. The document is still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/checks/async":{"post":{"operationId":"SpecialDocuments_checksAsync","tags":["checks"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a bank check in the background","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/clients":{"get":{"operationId":"ClientsController2_list","tags":["clients"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"GET /v1/clients","x-undocumented":true,"parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ClientsController2_create","tags":["clients"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"POST /v1/clients","x-undocumented":true,"parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"default":{"$ref":"#/components/responses/Error"}}}},"/v1/clients/{id}":{"delete":{"operationId":"ClientsController2_remove","tags":["clients"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"DELETE /v1/clients/:id","x-undocumented":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"ClientsController2_get","tags":["clients"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"GET /v1/clients/:id","x-undocumented":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"ClientsController2_update","tags":["clients"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"PATCH /v1/clients/:id","x-undocumented":true,"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"default":{"$ref":"#/components/responses/Error"}}}},"/v1/contacts":{"get":{"operationId":"Contacts_list","tags":["contacts"],"security":[{"session":[]},{"apiKey":["contacts:read"]},{"oauth2":["contacts:read"]}],"x-required-scope":"contacts:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List contacts","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"documentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"email","in":"query","required":false,"schema":{"type":"string","maxLength":254}},{"name":"phone","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"website","in":"query","required":false,"schema":{"type":"string","maxLength":300}},{"name":"city","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"region","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"postalCode","in":"query","required":false,"schema":{"type":"string","maxLength":20}},{"name":"country","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Contacts_create","tags":["contacts"],"security":[{"session":[]}],"x-required-feature":"business_cards","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a contact","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContactInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/contacts/{id}":{"delete":{"operationId":"Contacts_remove","tags":["contacts"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a contact","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Contacts_get","tags":["contacts"],"security":[{"session":[]},{"apiKey":["contacts:read"]},{"oauth2":["contacts:read"]}],"x-required-scope":"contacts:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a contact","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Contacts_update","tags":["contacts"],"security":[{"session":[]}],"x-required-feature":"business_cards","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a contact","description":"A field changed here stays when the card is read again.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateContactInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contact"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/contacts/{id}/vcard":{"get":{"operationId":"Contacts_vCard","tags":["contacts"],"security":[{"session":[]},{"apiKey":["contacts:read"]},{"oauth2":["contacts:read"]}],"x-required-scope":"contacts:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Download a contact as a vCard","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"text/vcard":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/contacts/export":{"post":{"operationId":"Contacts_export","tags":["contacts"],"security":[{"session":[]},{"apiKey":["contacts:read"]},{"oauth2":["contacts:read"]}],"x-required-scope":"contacts:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Export contacts as vCard or CSV","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactExportInput"},"example":{"format":"vcard"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"text/vcard":{"schema":{"type":"string","format":"binary"}},"text/csv":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/custom-fields":{"get":{"operationId":"CustomFields_list","tags":["custom-fields"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List custom fields","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"CustomFields_create","tags":["custom-fields"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"custom_fields","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a custom field","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomFieldInput"},"example":{"key":"string","label":"string","type":"TEXT"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomField"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/custom-fields/{id}":{"delete":{"operationId":"CustomFields_remove","tags":["custom-fields"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"custom_fields","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a custom field","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"CustomFields_get","tags":["custom-fields"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a custom field","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomField"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"CustomFields_update","tags":["custom-fields"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"custom_fields","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a custom field","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomFieldInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomField"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/delegations":{"get":{"operationId":"Delegations_list","tags":["delegations"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List who can act for whom","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DelegationPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Delegations_create","tags":["delegations"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Name a delegate","description":"Acting for someone then takes the X-Act-As header.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDelegationInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DelegationCreated"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/delegations/{id}":{"delete":{"operationId":"Delegations_remove","tags":["delegations"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"End a delegation","description":"It stops working on the next request. This works on a lapsed plan.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Delegations_update","tags":["delegations"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a delegation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDelegationInput"},"example":{"access":"FULL"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Delegation"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/devices":{"delete":{"operationId":"NotificationSettings_removeDevice","tags":["devices"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Remove a device from push","description":"Send the token in the body, or in the `token` query for a client that cannot send a body on DELETE.","parameters":[{"name":"token","in":"query","required":false,"schema":{"description":"The push token, for a client that cannot send a body on DELETE.","type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoveDeviceInput"},"example":{"token":"string"}}}},"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"NotificationSettings_registerDevice","tags":["devices"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Register a device for push","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterDeviceInput"},"example":{"token":"string","platform":"IOS"}}}},"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/document-settings":{"get":{"operationId":"DocumentSettings_view","tags":["document-settings"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get how this workspace reads and files documents","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"DocumentSettings_update","tags":["document-settings"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change how this workspace reads and files documents","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDocumentSettingsInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/document-settings/s3":{"delete":{"operationId":"DocumentSettings_removeS3","tags":["document-settings"],"security":[{"session":[]}],"x-required-permission":"security.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Disconnect the workspace's own S3 bucket","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"DocumentSettings_saveS3","tags":["document-settings"],"security":[{"session":[]}],"x-required-permission":"security.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Connect the workspace's own S3 bucket","description":"The secret is sealed when it arrives, and no route gives it back.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/S3AccessInput"},"example":{"accessKeyId":"string","secretAccessKey":"string","region":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/document-shares":{"get":{"operationId":"DocumentShares_list","tags":["document-shares"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List documents shared with or by the caller","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentShareList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentShares_create","tags":["document-shares"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Share documents with someone","description":"Answers with every share it made.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDocumentShareInput"},"example":{"userId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentShareList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/document-shares/{id}":{"delete":{"operationId":"DocumentShares_revoke","tags":["document-shares"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Take a share back","description":"Open on a lapsed plan: it only ever closes something.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/document-shares/{id}/accept":{"post":{"operationId":"DocumentShares_accept","tags":["document-shares"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Accept a shared document","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentShare"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents":{"get":{"operationId":"Documents_list","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List documents","description":"Ranges take __gt, __gte, __lt and __lte on created, updated, issued, total and tax: created__gte=2026-01-01, total__lt=5000. Issued, total and tax are what the document's expense holds, with whatever a person corrected, and a document with no expense has none. A day covers all of itself. order_by sorts, and a leading minus sorts down: -total. A document with no value comes last either way. A cursor resumes the created order only, so any other order pages with offset or page. is_empty names fields that must be empty. q searches the title, file name, notes, OCR text and extracted fields in any case; with an asterisk it searches the OCR text and extracted fields, case sensitive, and returns at most the newest 5,000 matches.","parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]}},{"name":"source_id","in":"query","required":false,"schema":{"type":"string","maxLength":255}},{"name":"external_id","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"blueprint_name","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"}},{"name":"owner","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"device_id","in":"query","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"}},{"name":"device_user_uuid","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"viewed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"trashed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"envelope","in":"query","required":false,"schema":{"type":"string"}},{"name":"created__gt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__gte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__lt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__lte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__gt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__gte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__lt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__lte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"issued","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__gt","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__gte","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__lt","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__lte","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"total","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__gt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__gte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__lt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__lte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__gt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__gte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__lt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__lte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"name":"category","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"vendor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"notes","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"payment_type","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"last_four_digits","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}$"}},{"name":"first_name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"last_name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"work_phone","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"cell_phone","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"email","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"website","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"country","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"state","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"city","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"zip","in":"query","required":false,"schema":{"type":"string","maxLength":20}},{"name":"name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"is_empty","in":"query","required":false,"schema":{"type":"string","maxLength":400}},{"name":"order_by","in":"query","required":false,"schema":{"type":"string","enum":["created","updated","issued","total","tax","-created","-updated","-issued","-total","-tax"]}},{"name":"folderId","in":"query","required":false,"schema":{"type":"string"}},{"name":"mailInBatchId","in":"query","required":false,"schema":{"type":"string"}},{"name":"setId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"archived","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"unviewed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"fraudColor","in":"query","required":false,"schema":{"type":"string","enum":["GREEN","YELLOW","RED"]}},{"name":"fraudSignal","in":"query","required":false,"schema":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]}},{"name":"fraudReview","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","FRAUD","NOT_FRAUD","UNKNOWN"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":10000}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":9007199254740991}},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50}},{"name":"track_total_results","in":"query","required":false,"schema":{"type":"boolean"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Documents_create","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Upload a file","description":"Multipart, or JSON naming an uploadId from POST /v1/uploads. The file's type comes from its bytes. Use a JPEG, PNG, WebP, HEIC, TIFF, PDF, DOCX, XLSX, CSV, TXT, HTML, EML or ZIP file. Up to 25 MB, or 50 MB for a PDF sent to be split into a set of documents. Reads best at 300 DPI for a PDF and 1000 pixels on the shorter side of an image. A ZIP unpacks into one document per file, up to 200 files and 200 MB, and each file counts against the plan. A ZIP inside a ZIP is refused. With a key this waits for the reading and answers with it, unless async is set. Name a type, or leave it out and the classifier says what it is.","parameters":[{"name":"client","in":"query","required":false,"schema":{"description":"The app sending the file. Leave it out in a browser.","type":"string","enum":["ios","android"]}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"categories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"taxonomy":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"allowed_async_enrichments":{"maxItems":10,"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"bounding_boxes":{"type":"boolean"},"confidence_details":{"type":"boolean"},"compute":{"type":"boolean"},"parse_address":{"type":"boolean"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50},"boost_mode":{"type":"boolean"},"auto_delete":{"type":"boolean"},"stitch":{"type":"boolean"},"crop_document":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"async":{"type":"boolean"},"line_item_expansion":{"type":"boolean"},"tiff_dpi":{"type":"number"},"type":{"default":"RECEIPT","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"clientId":{"type":"string","minLength":8,"maxLength":255},"externalId":{"type":"string","maxLength":200},"folderId":{"type":"string"},"notes":{"type":"string","maxLength":2000},"capturedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"locationAccuracyM":{"type":"number","minimum":0},"deviceId":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"},"merchantName":{"type":"string","minLength":1,"maxLength":255},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"totalMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"taxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"category":{"type":"string","minLength":1,"maxLength":120}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"categories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"taxonomy":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"allowed_async_enrichments":{"maxItems":10,"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"bounding_boxes":{"type":"boolean"},"confidence_details":{"type":"boolean"},"compute":{"type":"boolean"},"parse_address":{"type":"boolean"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50},"boost_mode":{"type":"boolean"},"auto_delete":{"type":"boolean"},"stitch":{"type":"boolean"},"crop_document":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"async":{"type":"boolean"},"line_item_expansion":{"type":"boolean"},"tiff_dpi":{"type":"number"},"type":{"default":"RECEIPT","type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"clientId":{"type":"string","minLength":8,"maxLength":255},"externalId":{"type":"string","maxLength":200},"folderId":{"type":"string"},"notes":{"type":"string","maxLength":2000},"capturedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"locationAccuracyM":{"type":"number","minimum":0},"deviceId":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"},"merchantName":{"type":"string","minLength":1,"maxLength":255},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"totalMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"taxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"category":{"type":"string","minLength":1,"maxLength":120}},"required":["uploadId"]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents-set":{"get":{"operationId":"DocumentSets_listDocumentsSets","tags":["documents-set"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List sets of documents","description":"Includes ZIPs and batches of addresses.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSetPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentSets_createDocumentsSet","tags":["documents-set"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Split a PDF and read each document in it","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Up to 250 pages and 50 MB. Answers at once. Each part fires document.processed and counts as a scan, and document_set.completed says when all are read.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents-set/{id}":{"get":{"operationId":"DocumentSets_getDocumentsSet","tags":["documents-set"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a set and the documents it made","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}":{"delete":{"operationId":"Documents_remove","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a document","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Documents_get","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a document and its extraction","description":"Links are signed again on every read, with no new reading. detailed=true adds the reading with each field wrapped as value, score, ocrScore, rotation, boundingBox, boundingRegion and enriched. with_scores=true adds lineItemsWithScores and taxLinesWithScores. recordStatus says processed, reviewed or archived. bounding_boxes=true adds every line read with its box and four corners, and where each field was read from: boundingBox as [page, x1, y1, x2, y2] and boundingRegion as [x1, y1, x2, y2, x3, y3, x4, y4], both as fractions of the page. confidence_details=true adds how sure the read of each field was. Both can be sent on a submission too.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"bounding_boxes","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"confidence_details","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"detailed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"with_scores","in":"query","required":false,"schema":{"type":"boolean"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Documents_update","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a document","description":"status REVIEWED marks it checked, approved sets your own flag, fraudReview records a decision, and billable, merchantName and the totals change its expense, under the rules of PATCH /v1/expenses/{id}. What can be refused is checked first, so nothing changes when any of it is.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDocumentInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Documents_replace","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a document, for a client written for PUT","description":"The same as PATCH: it changes what the body names and nothing else.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDocumentInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/cancel":{"post":{"operationId":"Documents_cancel","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Stop reading a document","description":"For filling in the details by hand. The file stays, and it can be read again.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/crop":{"post":{"operationId":"Documents_crop","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Crop a photo","description":"A box as fractions of the page as it shows now. The original stays as it came: a new page is drawn from it and read again, and it stays cropped through every later read. Only images can be cropped.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CropDocumentInput"},"example":{"x":0,"y":0,"width":0,"height":0}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/fraud-review":{"post":{"operationId":"FraudReview_review","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Record a person's decision on a document","description":"Fraud, not fraud or unknown, with the signals they agree with. A re-read replaces the evidence and leaves this alone. Nobody decides on their own upload except the workspace owner.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FraudReviewInput"},"example":{"decision":"FRAUD"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/line-items":{"delete":{"operationId":"DocumentLineItems_removeAll","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete every line item","description":"The total stays as the receipt printed it.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"DocumentLineItems_list","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a document's line items","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseLinePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentLineItems_create","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a line item","description":"The lines of the document's expense. When they added up to its total, a change to one moves the total and the converted amount with it. Refused once the expense is on a submitted report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseLineInput"},"example":{"description":"string","amountMinor":0}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseLine"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/line-items/{lineId}":{"delete":{"operationId":"DocumentLineItems_remove","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a line item","description":"The lines of the document's expense. When they added up to its total, a change to one moves the total and the converted amount with it. Refused once the expense is on a submitted report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"lineId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"DocumentLineItems_get","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a line item","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"lineId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseLine"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"DocumentLineItems_update","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a line item","description":"The lines of the document's expense. When they added up to its total, a change to one moves the total and the converted amount with it. Refused once the expense is on a submitted report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"lineId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExpenseLineInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseLine"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/ofx":{"get":{"operationId":"DocumentOfx_ofx","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Download a bank statement as OFX","description":"OFX 1.0.2, the file accounting software and personal finance programs import, from the latest reading of a bank statement: the rules' reading, Claude's, or the bank_statement blueprint's. Each account on the statement gets its own transactions, with FITIDs that stay the same each time. Account and routing numbers are masked, so match the file to an account when importing it. A document that is not a statement, or one with nothing read from it, answers 409 saying which.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/x-ofx":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/original":{"get":{"operationId":"DocumentsBulk_original","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a short-lived link to the original file","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentOriginal"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/pdf":{"get":{"operationId":"DocumentsBulk_pdf","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Download a document as a PDF","description":"A file that already is a PDF answers 302 to a short-lived link on storage, so follow the redirect, without your Authorization header. Anything else is built on the spot and comes back here.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/reprocess":{"post":{"operationId":"Documents_reprocess","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a document again","description":"Fields a person changed are left alone.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/reveal":{"post":{"operationId":"DocumentsReveal_reveal","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:reveal"]},{"oauth2":["documents:reveal"]}],"x-required-scope":"documents:reveal","x-required-permission":"documents.reveal","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Open the bank and tax numbers read from a document","description":"Needs the documents.reveal permission and, for a key, the documents:reveal scope. Every call writes an audit row. Also returns a link to the original file and, for a check, its TIFF images. Nothing else hands these out.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevealDocumentInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevealedDocument"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/rotate":{"post":{"operationId":"Documents_rotate","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Turn a page","description":"A quarter turn, counter-clockwise by default. The original stays as it came: a new page is drawn from it and read again, and it stays turned through every later read.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateDocumentInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/split":{"post":{"operationId":"DocumentSplit_split","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Split a PDF already uploaded","description":"Every page, or the ranges given. Each part is a document and counts as a scan, and the whole goes to the trash once the parts exist.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"client","in":"query","required":false,"schema":{"description":"The app sending the file. Leave it out in a browser.","type":"string","enum":["ios","android"]}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitDocumentInput"},"example":{"mode":"every_page"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/tags":{"delete":{"operationId":"DocumentTags_removeAll","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Take every tag off a document","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"DocumentTags_list","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a document's tags","description":"Any type of document: receipts, checks, bank statements, business cards, contracts, tax forms and the rest.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTagList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentTags_addMany","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add several tags to a document","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTagsInput"},"example":{"tags":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTagList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"DocumentTags_add","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a tag to a document","description":"By name. A name the workspace does not have makes the tag. Adding one it already has changes nothing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTagInput"},"example":{"name":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentTagList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/tags/{tagId}":{"delete":{"operationId":"DocumentTags_remove","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Take a tag off a document","description":"The tag stays in the workspace.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"tagId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/tax-lines":{"get":{"operationId":"DocumentTaxLines_list","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a document's tax lines","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseTaxLinePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentTaxLines_create","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a tax line","description":"The expense's tax is the sum of its tax lines. When its total was what is under the tax and on top of it, the total moves with the tax. Refused once the expense is on a submitted report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseTaxLineInput"},"example":{"amountMinor":0}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseTaxLine"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/tax-lines/{taxLineId}":{"delete":{"operationId":"DocumentTaxLines_remove","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a tax line","description":"The expense's tax is the sum of its tax lines. When its total was what is under the tax and on top of it, the total moves with the tax. Refused once the expense is on a submitted report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"taxLineId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"DocumentTaxLines_get","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a tax line","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"taxLineId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseTaxLine"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"DocumentTaxLines_update","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a tax line","description":"The expense's tax is the sum of its tax lines. When its total was what is under the tax and on top of it, the total moves with the tax. Refused once the expense is on a submitted report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"taxLineId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExpenseTaxLineInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseTaxLine"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/text":{"get":{"operationId":"DocumentsBulk_text","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the text read from a document","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentText"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/{id}/viewed":{"post":{"operationId":"DocumentsBulk_viewed","tags":["documents"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Mark a document as viewed","description":"Reading is not a change to the record, so this stays open after a plan lapses.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/any":{"post":{"operationId":"DocumentExtraction_any","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a document with a blueprint","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. The answer is in blueprint.result. Without a Claude key on the server, blueprint.error says so and the text is still read. 20 pages by default and 50 at most.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","blueprint_name"],"properties":{"file":{"type":"string","format":"binary"},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50}}},"example":{"blueprint_name":"string"}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50}},"description":"Name the file with one of uploadId, file_url or file_data.","required":["blueprint_name"],"allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string","blueprint_name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/any/async":{"post":{"operationId":"DocumentExtraction_anyAsync","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a document with a blueprint, in the background","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Answers at once. document.processed says when it is done.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","blueprint_name"],"properties":{"file":{"type":"string","format":"binary"},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50}}},"example":{"blueprint_name":"string"}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50}},"description":"Name the file with one of uploadId, file_url or file_data.","required":["blueprint_name"],"allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string","blueprint_name":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/batch":{"post":{"operationId":"DocumentExtraction_batch","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Submit up to 100 addresses at once","description":"Answers at once with a set. Each address becomes a document with its own webhook, and an address that fails is listed under refused without stopping the rest.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchDocumentsInput"},"example":{"file_urls":["string"]}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/bulk":{"post":{"operationId":"DocumentsBulk_run","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Act on many documents","description":"Send ids, or a filter to act on everything that matches. With a filter, call again with nextCursor until it is null.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDocumentInput"},"example":{"action":{"type":"move","folderId":"string"}}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDocumentResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/classify":{"post":{"operationId":"DocumentExtraction_classify","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Say what a document is","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Answers with a value and a score, from the built-in list or from document_types. It works with no Claude key for the common types, and Claude only decides what the rules cannot.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Classification"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/count":{"get":{"operationId":"DocumentsBulk_count","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Count the documents a filter matches","parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]}},{"name":"source_id","in":"query","required":false,"schema":{"type":"string","maxLength":255}},{"name":"external_id","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"blueprint_name","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"}},{"name":"owner","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"device_id","in":"query","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"}},{"name":"device_user_uuid","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"viewed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"trashed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"envelope","in":"query","required":false,"schema":{"type":"string"}},{"name":"created__gt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__gte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__lt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__lte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__gt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__gte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__lt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__lte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"issued","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__gt","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__gte","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__lt","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__lte","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"total","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__gt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__gte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__lt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__lte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__gt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__gte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__lt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__lte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"name":"category","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"vendor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"notes","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"payment_type","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"last_four_digits","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}$"}},{"name":"first_name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"last_name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"work_phone","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"cell_phone","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"email","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"website","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"country","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"state","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"city","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"zip","in":"query","required":false,"schema":{"type":"string","maxLength":20}},{"name":"name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"is_empty","in":"query","required":false,"schema":{"type":"string","maxLength":400}},{"name":"order_by","in":"query","required":false,"schema":{"type":"string","enum":["created","updated","issued","total","tax","-created","-updated","-issued","-total","-tax"]}},{"name":"folderId","in":"query","required":false,"schema":{"type":"string"}},{"name":"mailInBatchId","in":"query","required":false,"schema":{"type":"string"}},{"name":"setId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"archived","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"unviewed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"fraudColor","in":"query","required":false,"schema":{"type":"string","enum":["GREEN","YELLOW","RED"]}},{"name":"fraudSignal","in":"query","required":false,"schema":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]}},{"name":"fraudReview","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","FRAUD","NOT_FRAUD","UNKNOWN"]}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentCount"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/extract":{"post":{"operationId":"DocumentExtraction_extract","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Say what a document is and read it, in one call","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. document_types may name built-in types and blueprints. Answers with extraction, or extraction_error when it could not be read.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Extraction"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/split":{"post":{"operationId":"DocumentSplit_splitUpload","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Split a PDF on storage into documents","description":"The PDF named by uploadId, from POST /v1/uploads with purpose document_set, up to 50 MB. mode says where it is cut, and detect is the default. Each part is a document, counts as a scan and is held to 25 MB: a part past that is listed under refused, and the rest are filed.","parameters":[{"name":"client","in":"query","required":false,"schema":{"description":"The app sending the file. Leave it out in a browser.","type":"string","enum":["ios","android"]}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitUploadInput"},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/trash":{"get":{"operationId":"DocumentsBulk_trashed","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List deleted documents","description":"Each can be restored for 30 days.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrashedDocumentPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentsBulk_emptyOrRestore","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Restore deleted documents, or delete them for good","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrashActionInput"},"example":{"action":"restore"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrashActionResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/documents/url":{"post":{"operationId":"PublicDocuments_submit","tags":["documents"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Submit a file by URL or base64","description":"By default the call waits up to 30 seconds and returns the extraction with 201. With async: true, or if reading takes longer, it answers 202 and the document.processed webhook says when it is done. file_url must be public https; redirects are not followed. file_urls reads several images as one document, in order. bucket and package_path read from your own S3 bucket, with keys saved in document settings. Use a JPEG, PNG, WebP, HEIC, TIFF, PDF, DOCX, XLSX, CSV, TXT, HTML, EML or ZIP file. Up to 25 MB, or 50 MB for a PDF sent to be split into a set of documents. Reads best at 300 DPI for a PDF and 1000 pixels on the shorter side of an image. A ZIP unpacks into one document per file, up to 200 files and 200 MB, and each file counts against the plan. A ZIP inside a ZIP is refused.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"202":{"description":"Accepted. The document is still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains":{"get":{"operationId":"Domains_list","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List the domains the caller runs","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Domains_claim","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Claim a domain","description":"The caller's verified sign-in address must be on it. Public mail domains are refused.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimDomainInput"},"example":{"name":"string","workspaceId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}":{"delete":{"operationId":"Domains_release","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Give up a domain","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Domains_get","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Get a domain","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Domains_update","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Change a domain","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDomainInput"},"example":{"joinPolicy":"INVITE_ONLY"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}/access-requests":{"get":{"operationId":"Domains_accessRequests","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List who has asked to help run a domain","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainAccessRequestList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}/access-requests/{requestId}":{"post":{"operationId":"Domains_decideAccess","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Answer a request to help run a domain","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"requestId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideAccessInput"},"example":{"approve":false}}}},"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}/admins":{"get":{"operationId":"Domains_admins","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List domain admins","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainAdminList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Domains_addAdmin","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Add a domain admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddDomainAdminInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainAdminList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}/admins/{userId}":{"delete":{"operationId":"Domains_removeAdmin","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Remove a domain admin","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}/groups":{"get":{"operationId":"Domains_groups","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List domain groups","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainGroupList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Domains_createGroup","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Create a domain group","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainGroupInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainGroup"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}/groups/{groupId}":{"delete":{"operationId":"Domains_deleteGroup","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Delete a domain group","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"groupId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Domains_updateGroup","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Change a domain group","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"groupId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainGroupInput"},"example":{"name":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainGroup"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}/groups/{groupId}/members/{userId}":{"put":{"operationId":"Domains_placeInGroup","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Put a person in a domain group","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"groupId","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}/invite":{"post":{"operationId":"Domains_invite","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Invite someone from a domain","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainInviteInput"},"example":{"email":"someone@example.com"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainInviteResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}/members":{"get":{"operationId":"Domains_members","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List the people on a domain","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainMemberList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}/members/{userId}/close":{"post":{"operationId":"Domains_closeAccount","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Close a domain member's account","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}/migrations":{"post":{"operationId":"Domains_migrate","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Start moving people into a domain","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartDomainMigrationInput"},"example":{"toDomainId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainMigration"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}/migrations/{migrationId}":{"get":{"operationId":"Domains_migration","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"See how a domain migration stands","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"migrationId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainMigration"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}/report":{"get":{"operationId":"Domains_report","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Get a domain's report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainReport"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}/vacation-delegates":{"post":{"operationId":"Domains_vacationDelegate","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Set a vacation delegate for a domain member","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VacationDelegateInput"},"example":{"userId":"string","delegateId":"string","endsAt":"2026-01-31T12:00:00.000Z"}}}},"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/{id}/verify":{"post":{"operationId":"Domains_verify","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Check a domain's DNS record","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Domain"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/domains/access-requests":{"post":{"operationId":"Domains_requestAccess","tags":["domains"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Ask to help run a domain","description":"Answers 202. A domain admin decides.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestDomainAccessInput"},"example":{"name":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DomainAccessRequested"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/email/unsubscribe":{"get":{"operationId":"Unsubscribe_preview","tags":["email"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"See what an unsubscribe link would stop","description":"Needs no sign-in: the token in the link proves who it is for.","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","minLength":16,"maxLength":500}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unsubscribe"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Unsubscribe_unsubscribe","tags":["email"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Unsubscribe with one click","description":"As RFC 8058 has it. The token comes in the query or the body.","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","minLength":16,"maxLength":500}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsubscribeInput"},"example":{"token":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Unsubscribe"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses":{"get":{"operationId":"Expenses_list","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List expenses","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","enum":["date:asc","date:desc","merchant:asc","merchant:desc","category:asc","category:desc","status:asc","status:desc","amount:asc","amount:desc"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpensePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Expenses_create","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create an expense","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExpenseInput"},"example":{"date":"string","amountMinor":0}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}":{"delete":{"operationId":"Expenses_remove","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Void an expense","description":"A voided expense stays for audit and leaves every total.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Expenses_get","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get an expense","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Expenses_update","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change an expense","description":"Send If-Match with the updatedAt you last read to make this conditional: if someone changed the expense since, it answers 409 CONFLICT with details.reason STALE_WRITE and changes nothing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"If-Match","in":"header","required":false,"description":"The expense's updatedAt, as read.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExpenseInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/comments":{"get":{"operationId":"ExpenseThread_list","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List comments on an expense","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ExpenseThread_add","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Comment on an expense","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostedComment"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/comments/{commentId}/reach":{"post":{"operationId":"ExpenseThread_reach","tags":["expenses"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Reach someone a comment on this expense could not","description":"An expense has no participants of its own, so they join the report it is on, and then they are told. Refused when it is on no report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"commentId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReachMentionedInput"},"example":{"userIds":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reached"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/comments/mentionable":{"get":{"operationId":"ExpenseThread_mentionable","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List who a comment on this expense can mention","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MentionablePeople"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/confirm":{"post":{"operationId":"Expenses_confirm","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Confirm an expense after review","description":"A reviewer's sign-off: the extraction is right, so the expense leaves the review list.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/duplicate":{"post":{"operationId":"ExpenseThread_duplicate","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Copy an expense, dated today, with no receipt","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedId"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/duplicates":{"get":{"operationId":"Expenses_duplicates","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List an expense and its possible duplicates","description":"Every copy in the group, not just a pair. hidden counts any the caller cannot read.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDuplicateGroup"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/flags/{code}/dismiss":{"post":{"operationId":"ExpenseThread_dismissFlag","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Dismiss a flag on an expense","description":"For whoever has it for approval, or someone who manages expenses. The flag goes from the expense and stays in the audit log. Not for a hold.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"code","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DismissFlagInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hold"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/history":{"get":{"operationId":"Expenses_history","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"What happened to an expense, oldest first","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseHistory"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/hold":{"post":{"operationId":"ExpenseThread_hold","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Put an expense on hold","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HoldExpenseInput"},"example":{"reason":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hold"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/keep":{"post":{"operationId":"Expenses_keep","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Keep both expenses of a likely duplicate","description":"A person compared the pair and these are two purchases, so the duplicate flag comes off.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/mark-cash":{"post":{"operationId":"Expenses_markCash","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Mark an expense as paid in cash","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/move":{"post":{"operationId":"ExpenseMove_move","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Move your expense to another of your workspaces","description":"Makes it new there and voids the row here, which stays for audit. A trip is priced by the destination's rate, in its currency and unit. Refused once the expense is on a report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveExpenseInput"},"example":{"workspaceId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MovedExpense"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/public-link":{"get":{"operationId":"PublicReceiptLinks_link","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get an expense's public receipt link","description":"Whoever can read the expense can ask, while the workspace has public receipts on.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicReceiptLink"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/receipts":{"post":{"operationId":"ExpenseReceipts_attach","tags":["expenses"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Attach a receipt to an expense","description":"Multipart, or JSON naming an uploadId from POST /v1/uploads. add files it beside what is there, and a first receipt on a receipt expense is read onto it. replace takes the current ones to the trash and reads the new one. Fields a person changed are left alone.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"client","in":"query","required":false,"schema":{"description":"The app sending the file. Leave it out in a browser.","type":"string","enum":["ios","android"]}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"mode":{"default":"add","type":"string","enum":["add","replace"]},"clientId":{"type":"string","minLength":8,"maxLength":255},"deviceId":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"mode":{"default":"add","type":"string","enum":["add","replace"]},"clientId":{"type":"string","minLength":8,"maxLength":255},"deviceId":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"}},"required":["uploadId"]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Document"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/restore":{"post":{"operationId":"Expenses_restore","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Restore a voided expense","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/settle-duplicates":{"post":{"operationId":"Expenses_settleDuplicates","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Answer a duplicate question","description":"keep all takes the hold off every one of them. keep selected keeps this one, discards the others and can take values from them, all in one step. The submitter and whoever holds the open approval can do this on an outstanding report.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettleDuplicatesInput"},"example":{"keep":"all"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/split":{"get":{"operationId":"Expenses_splitRows","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"The parts a split expense has now","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitRows"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Expenses_split","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Split an expense into parts","description":"Answers with the expenses it became.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SplitExpenseInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetails"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Expenses_editSplit","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change the parts of a split expense","description":"A row with an id changes that part, a row with none adds one, and a part left out goes. One row left turns it back into a single expense.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditSplitInput"},"example":{"rows":[{"amountMinor":0}]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetails"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/tag-suggestions":{"get":{"operationId":"Expenses_tagSuggestions","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Tags similar past expenses carried","description":"From the same person's earlier expenses at this merchant. Nothing goes on until someone takes it, and a group already filled is left out.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagSuggestionList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/tax-lines":{"get":{"operationId":"ExpenseTaxLines_list","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List an expense's tax lines","description":"For an expense with a receipt or without one. A document's own tax lines are under /v1/documents/{id}/tax-lines.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseTaxLinePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ExpenseTaxLines_create","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a tax line to an expense","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseTaxLineInput"},"example":{"amountMinor":0}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseTaxLine"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/tax-lines/{taxLineId}":{"delete":{"operationId":"ExpenseTaxLines_remove","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Remove a tax line from an expense","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"taxLineId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/{id}/unhold":{"post":{"operationId":"ExpenseThread_unhold","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Take an expense off hold","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hold"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/attendees/recent":{"get":{"operationId":"Expenses_recentAttendees","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"People the caller has listed on expenses lately","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecentAttendees"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/bulk":{"post":{"operationId":"Expenses_bulk","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change many expenses","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkExpenseInput"},"example":{"ids":["string"],"action":{"type":"set_category","categoryId":"string"}}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkExpenseResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/bulk/edit":{"post":{"operationId":"Expenses_bulkEdit","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Overwrite the same fields on several expenses","description":"Each field named replaces what every selected expense holds. Expenses the caller cannot edit are skipped and counted.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkEditInput"},"example":{"ids":["string"],"fields":{}}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkEditResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/bulk/options":{"post":{"operationId":"Expenses_bulkEditOptions","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Which fields Edit multiple can change for a selection","description":"A field restricted on any selected expense is closed, with the reason.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkEditOptionsInput"},"example":{"ids":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkEditOptions"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/duplicates":{"post":{"operationId":"ExpenseMoves_duplicate","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Duplicate expenses","description":"Up to 50 at a time. Each is copied by itself, and one that cannot be comes back in skipped with why.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DuplicateExpensesInput"},"example":{"ids":["string"]}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpensesDuplicated"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/groups":{"get":{"operationId":"Expenses_groups","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Group the expenses that match a filter, with each group's total","description":"As far as the caller reaches: someone who can read only their own expenses groups only those.","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"groupBy","in":"query","required":true,"schema":{"type":"string","enum":["category","merchant","member","project","status","month"]}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseGroups"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/hold":{"post":{"operationId":"ExpenseMoves_hold","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Hold or release expenses","description":"Each by the rules for holding one: whose it is, and how far it has gone. One that cannot change comes back in skipped with why.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkHoldInput"},"example":{"action":"hold","ids":["string"],"reason":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpensesHeld"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/merge":{"post":{"operationId":"Expenses_merge","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Merge two expenses into one","description":"keepId stays and the other is gone for good. What to keep of each is chosen field by field. An imported card expense is always the one kept.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeExpensesInput"},"example":{"keepId":"string","otherId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/money-flow":{"get":{"operationId":"Expenses_moneyFlow","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Money in beside money out, a month at a time","parameters":[{"name":"months","in":"query","required":false,"schema":{"default":6,"type":"integer","minimum":1,"maximum":12}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoneyFlow"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/move":{"post":{"operationId":"ExpenseMoves_move","tags":["expenses"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Move expenses to a report","description":"To a report that is a draft or still out for approval, a new draft, the draft automatic reporting is filling, or off every report. A report holds one person's expenses. Each expense is judged by itself, and one that cannot move comes back in skipped with why.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveExpensesInput"},"example":{"ids":["string"],"to":{"type":"report","reportId":"string"}}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpensesMoved"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/expenses/totals":{"get":{"operationId":"Expenses_totals","tags":["expenses"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Total the expenses that match a filter, or the ones selected, in any currency","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},{"type":"array","items":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]}}]}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]}},{"name":"paymentType","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","all"]}},{"name":"categoryId","in":"query","required":false,"schema":{"type":"string"}},{"name":"merchantId","in":"query","required":false,"schema":{"type":"string"}},{"name":"projectId","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"tagId","in":"query","required":false,"schema":{"type":"string"}},{"name":"department","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"reportId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"unreported","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"needsReview","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"billable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"reimbursable","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"moneyFlow","in":"query","required":false,"schema":{"type":"string","enum":["IN","OUT"]}},{"name":"dateField","in":"query","required":false,"schema":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"ids","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"maxItems":500,"type":"array","items":{"type":"string","minLength":1}}]}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseTotals"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/export-history":{"get":{"operationId":"ExportHistory_list","tags":["export-history"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-permission":"expenses.read_all","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List which documents went where","description":"Files from exports, postings to connected services, and what programs recorded, with the id each has there. Needs expenses.read_all.","parameters":[{"name":"documentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"target","in":"query","required":false,"schema":{"type":"string","maxLength":60}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"via","in":"query","required":false,"schema":{"type":"string","enum":["EXPORT","SYNC","API"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportRecordPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ExportHistory_append","tags":["export-history"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Record that documents went somewhere","description":"For an export a program made itself. A record already held is not written again, so a retry is safe.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportRecordInput"},"example":{"documentIds":["string"],"target":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportRecordsAppended"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/export-templates":{"get":{"operationId":"ExportTemplates_list","tags":["export-templates"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List export templates","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportTemplateList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ExportTemplates_create","tags":["export-templates"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create an export template","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportTemplateInput"},"example":{"name":"string","columns":[{"key":"string"}]}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportTemplate"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/export-templates/{id}":{"delete":{"operationId":"ExportTemplates_remove","tags":["export-templates"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete an export template","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"ExportTemplates_update","tags":["export-templates"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change an export template","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExportTemplateInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportTemplate"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/exports":{"get":{"operationId":"Exports_list","tags":["exports"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List exports","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportJobPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Exports_create","tags":["exports"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Start an export","description":"Filters select by expense, or by report with reportState, reportIds, startDate and endDate (one year at most), approvedAfter and exported. policyIds takes workspace ids, and a key can only name its own. `template` is the file's whole layout as text, with ${expense.merchant}, <#list reports as report> and <#if report.exported>, and takes CSV, TXT, JSON or XML: a mistake in it answers 422 with the line. `onFinish` can email the file, mark the reports it covers as exported, which needs reports:write, and upload it by SFTP. SFTP needs the host key fingerprint of the server, refuses a private address, and never returns the credentials.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExportInput"},"example":{"kind":"expenses","format":"CSV"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportJob"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/exports/{id}":{"get":{"operationId":"Exports_get","tags":["exports"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get an export and, when ready, its link","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportJob"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/folders":{"get":{"operationId":"Folders_list","tags":["folders"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List folders","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"parentId","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Folders_create","tags":["folders"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"expenses.write_all","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a folder","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FolderInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Folder"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/folders/{id}":{"delete":{"operationId":"Folders_remove","tags":["folders"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"expenses.write_all","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a folder","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Folders_get","tags":["folders"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a folder","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Folder"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Folders_update","tags":["folders"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"expenses.write_all","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a folder","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateFolderInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Folder"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/forwarding":{"get":{"operationId":"Forwarding_view","tags":["forwarding"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the addresses that receive documents by email","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forwarding"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/forwarding/emails":{"get":{"operationId":"Forwarding_recent","tags":["forwarding"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List email sent to the caller's forwarding addresses","description":"Every message, filed or not, with the sender, subject, received time, whether it carried a file, and any file left out and why.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundEmailPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/forwarding/merchant-copies":{"post":{"operationId":"Forwarding_merchantCopies","tags":["forwarding"],"security":[{"session":[]}],"x-required-feature":"email_capture","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Choose which merchants copied receipts come from","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantCopiesInput"},"example":{"enabled":false}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Forwarding"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/forwarding/senders":{"post":{"operationId":"Forwarding_addSender","tags":["forwarding"],"security":[{"session":[]}],"x-required-feature":"email_capture","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a sender address","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddSenderInput"},"example":{"email":"someone@example.com"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForwardingSender"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/forwarding/senders/{id}":{"delete":{"operationId":"Forwarding_removeSender","tags":["forwarding"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Remove a sender address","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/forwarding/senders/verify":{"post":{"operationId":"Forwarding_verify","tags":["forwarding"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Verify a sender address","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifySenderInput"},"example":{"token":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForwardingSender"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/fraud/blocklist":{"get":{"operationId":"Fraud_blocklist","tags":["fraud"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-permission":"expenses.read_all","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List blocked devices","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceBlockPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Fraud_block","tags":["fraud"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Block a device","description":"A blocked device still captures. Its documents read red, with the reason stated, for a reviewer.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockDeviceInput"},"example":{"deviceId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceBlock"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/fraud/blocklist/{deviceId}":{"delete":{"operationId":"Fraud_unblock","tags":["fraud"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Remove a device from the blocklist","parameters":[{"name":"deviceId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Fraud_blockStatus","tags":["fraud"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-permission":"expenses.read_all","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Check whether a device is blocked","description":"A device nobody blocked answers blocked: false, not 404.","parameters":[{"name":"deviceId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceBlockStatus"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/fraud/export":{"get":{"operationId":"Fraud_export","tags":["fraud"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-permission":"expenses.read_all","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Download the evidence on documents that match a filter","description":"The same filter as listing documents. Needs expenses.read_all.","parameters":[{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]}},{"name":"source_id","in":"query","required":false,"schema":{"type":"string","maxLength":255}},{"name":"external_id","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"blueprint_name","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"}},{"name":"owner","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"device_id","in":"query","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"}},{"name":"device_user_uuid","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"viewed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"trashed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"envelope","in":"query","required":false,"schema":{"type":"string"}},{"name":"created__gt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__gte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__lt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"created__lte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__gt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__gte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__lt","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"updated__lte","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]}},{"name":"issued","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__gt","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__gte","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__lt","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"issued__lte","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"total","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__gt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__gte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__lt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"total__lte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__gt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__gte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__lt","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"tax__lte","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"name":"category","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"vendor","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"notes","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"payment_type","in":"query","required":false,"schema":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]}},{"name":"last_four_digits","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}$"}},{"name":"first_name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"last_name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"work_phone","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"cell_phone","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"email","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"website","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"country","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"state","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"city","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"zip","in":"query","required":false,"schema":{"type":"string","maxLength":20}},{"name":"name","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"is_empty","in":"query","required":false,"schema":{"type":"string","maxLength":400}},{"name":"order_by","in":"query","required":false,"schema":{"type":"string","enum":["created","updated","issued","total","tax","-created","-updated","-issued","-total","-tax"]}},{"name":"folderId","in":"query","required":false,"schema":{"type":"string"}},{"name":"mailInBatchId","in":"query","required":false,"schema":{"type":"string"}},{"name":"setId","in":"query","required":false,"schema":{"type":"string"}},{"name":"externalId","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"archived","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"unviewed","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"fraudColor","in":"query","required":false,"schema":{"type":"string","enum":["GREEN","YELLOW","RED"]}},{"name":"fraudSignal","in":"query","required":false,"schema":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]}},{"name":"fraudReview","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","FRAUD","NOT_FRAUD","UNKNOWN"]}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/fraud/my-device/{deviceId}":{"get":{"operationId":"Fraud_myDevice","tags":["fraud"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Ask whether this device is blocked","description":"For a device asking about itself: any member can, and it says only whether. Capture carries on either way.","parameters":[{"name":"deviceId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyDeviceStatus"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/fraud/settings":{"get":{"operationId":"Fraud_settings","tags":["fraud"],"security":[{"session":[]}],"x-required-permission":"expenses.read_all","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the fraud check settings","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FraudSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Fraud_saveSettings","tags":["fraud"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change the fraud check settings","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FraudSettingsInput"},"example":{"enabled":false,"yellowAt":0.05,"redAt":0.05,"profiles":{"RECEIPTS":{"signals":{},"monitoredFields":["totalMinor"]},"CHECKS":{"signals":{},"monitoredFields":["totalMinor"]},"BANK_STATEMENTS":{"signals":{},"monitoredFields":["totalMinor"]}},"suspiciousWords":["string"],"pdfCreatorKeywords":["string"],"velocity":{"high":{"lastMinutes":1,"lastDay":1,"lastWeek":1,"last2Weeks":1,"lastMonth":1},"critical":{"lastMinutes":1,"lastDay":1,"lastWeek":1,"last2Weeks":1,"lastMonth":1}},"duplicateSpike":{"enabled":false,"percent":1,"minVolume":50}}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FraudSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/home":{"get":{"operationId":"Home_view","tags":["home"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get your home screen","description":"What can stop your work today, what reports wait on you, upcoming travel, insights from your own expenses and announcements. Spending shows for someone who can see it.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Home"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/inbox":{"get":{"operationId":"Chat_inbox","tags":["inbox"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List what is waiting on the caller in chat","parameters":[{"name":"tab","in":"query","required":false,"schema":{"default":"all","type":"string","enum":["all","unread","todos"]}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Inbox"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations":{"get":{"operationId":"Integrations_list","tags":["integrations"],"security":[{"session":[]},{"apiKey":["integrations:read"]},{"oauth2":["integrations:read"]}],"x-required-scope":"integrations:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List connected services and what can be connected","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}":{"delete":{"operationId":"Integrations_disconnect","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Disconnect a service","description":"Open on a lapsed plan: taking away access is never something to charge for.","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisconnectResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/connect":{"post":{"operationId":"Integrations_connect","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Start connecting a service","description":"Answers with the provider's sign-in link. Open it in a browser: the provider sends the person back to PaperTotal.","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/health":{"get":{"operationId":"Integrations_health","tags":["integrations"],"security":[{"session":[]},{"apiKey":["integrations:read"]},{"oauth2":["integrations:read"]}],"x-required-scope":"integrations:read","x-required-permission":"integrations.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See how a connection stands","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationHealth"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/import":{"get":{"operationId":"Accounting_getImport","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get what comes in from a service","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Import"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Accounting_saveImport","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change what comes in from a service","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateImportSettingsInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Import"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/invite-employees":{"post":{"operationId":"Accounting_inviteEmployees","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Invite the employees a service lists","description":"Inviting people is managing members, so this needs members.manage, whoever manages the connection.","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteEmployeesResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/mappings":{"get":{"operationId":"Integrations_getMappings","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the account mappings","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Mappings"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Integrations_saveMappings","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change the account mappings","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMappingsInput"},"example":{"mappings":[{"entity":"category","localId":"string","externalId":"string"}]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveMappingsResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/organisation":{"post":{"operationId":"Integrations_chooseOrganisation","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Choose which organisation to post to","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChooseOrganisationInput"},"example":{"organisationId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Integration"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/records":{"get":{"operationId":"Integrations_records","tags":["integrations"],"security":[{"session":[]},{"apiKey":["integrations:read"]},{"oauth2":["integrations:read"]}],"x-required-scope":"integrations:read","x-required-permission":"integrations.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List what was sent to a service","description":"Each record names the expense and the id it has in the other system.","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","SYNCED","FAILED","SKIPPED","VOIDED"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRecordPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/records/{id}/retry":{"post":{"operationId":"Integrations_retry","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Try a failed record again","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRecord"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/records/{id}/skip":{"post":{"operationId":"Integrations_skip","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Skip a failed record","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRecord"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/refresh":{"post":{"operationId":"Integrations_refresh","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Pull the service's reference data again","description":"Answers 202 and carries on in the background.","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"202":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/resume":{"post":{"operationId":"Accounting_resume","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Resume posting after a failure","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/review":{"get":{"operationId":"Accounting_review","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List what would post, with any problems","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"resend","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Review"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/review/{expenseId}":{"patch":{"operationId":"Accounting_recode","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Recode an expense before it posts","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"name":"expenseId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecodeExpenseInput"},"example":{}}}},"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/review/calc-gst":{"post":{"operationId":"Accounting_calcGst","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Work out GST on some expenses","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalcGstInput"},"example":{"expenseIds":["00000000-0000-7000-8000-000000000000"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatedCount"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/settings":{"get":{"operationId":"Accounting_getSettings","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get how a service posts","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Accounting_saveSettings","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change how a service posts","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateExportSettingsInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/storage":{"get":{"operationId":"Storage_status","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See how a storage service stands","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageStatus"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Storage_update","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change what goes to a storage service","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateStorageInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StorageStatus"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/sync":{"post":{"operationId":"Integrations_sync","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Post expenses to the service","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/vendors":{"get":{"operationId":"Accounting_vendors","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a service's vendors","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/vendors/{id}":{"patch":{"operationId":"Accounting_updateVendor","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a vendor","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVendorInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vendor"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/{provider}/vendors/{id}/account":{"put":{"operationId":"Accounting_setVendorAccount","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Set the account a vendor posts to","parameters":[{"name":"provider","in":"path","required":true,"description":"The service, by its slug: quickbooks-online, quickbooks-desktop, xero, freshbooks, wave, zoho-books, sage, microsoft-dynamics, myob, oracle, sap, netsuite, gusto, hr, gmail, google-drive, dropbox, box, onedrive, slack, zapier.","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorAccountInput"},"example":{"accountId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VendorAccount"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/expenses/{expenseId}/vendor":{"get":{"operationId":"Accounting_expenseVendor","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See the vendor an expense posts to","parameters":[{"name":"expenseId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseVendor"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Accounting_pickVendor","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Choose the vendor an expense posts to","parameters":[{"name":"expenseId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseVendorInput"},"example":{"vendorId":"00000000-0000-7000-8000-000000000000"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseVendor"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/gmail/scan":{"get":{"operationId":"Gmail_status","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See how the Gmail scan stands","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GmailScan"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Gmail_scan","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Scan Gmail now","description":"Answers 202 and carries on in the background.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"202":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/netsuite/credentials":{"put":{"operationId":"NetSuite_saveCredentials","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Save NetSuite credentials","description":"Write-only: no route reads these back. The next step is the ordinary connect.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetSuiteCredentialsInput"},"example":{"accountId":"string","clientId":"string","folderId":"string"}}}},"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/quickbooks-desktop/iif":{"post":{"operationId":"WebConnector_importIif","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import QuickBooks Desktop lists from an IIF file","description":"Takes an upload from POST /v1/uploads with purpose iif_lists. Reads accounts, customers, vendors, items and classes, and the file is gone once read.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportIifInput"},"example":{"uploadId":"00000000-0000-7000-8000-000000000000"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IifImport"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/quickbooks-desktop/reusable":{"get":{"operationId":"WebConnector_reusable","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List connectors another workspace of yours could share","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReusableConnectorList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/quickbooks-desktop/reuse":{"post":{"operationId":"WebConnector_reuse","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Share a connector another workspace of yours set up","description":"One company file takes one connector, so a second workspace on the same file shares it.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReuseConnectorInput"},"example":{"connectionId":"00000000-0000-7000-8000-000000000000"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesktopSetup"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/quickbooks-desktop/setup":{"post":{"operationId":"WebConnector_setup","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Set up QuickBooks Desktop","description":"Answers with the file to open in the Web Connector.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DesktopSetup"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/integrations/slack/settings":{"get":{"operationId":"Slack_read","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the Slack settings","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Slack_save","tags":["integrations"],"security":[{"session":[]}],"x-required-permission":"integrations.manage","x-required-feature":"accounting_sync","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change the Slack settings","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackSettingsInput"},"example":{"channelId":"string","receipts":"OFF"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invitations":{"get":{"operationId":"Invitations_list","tags":["invitations"],"security":[{"session":[]},{"apiKey":["members:read"]},{"oauth2":["members:read"]}],"x-required-scope":"members:read","x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List invitations","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","EXPIRED","ACCEPTED","REVOKED"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Invitations_create","tags":["invitations"],"security":[{"session":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"x-required-scope":"members:write","x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Invite someone to this workspace","description":"They join when they accept, signed in with this address. An open invitation holds a seat.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvitationInput"},"example":{"email":"someone@example.com"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationSent"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invitations/{id}":{"delete":{"operationId":"Invitations_revoke","tags":["invitations"],"security":[{"session":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"x-required-scope":"members:write","x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Withdraw an invitation","description":"Works on a lapsed plan.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invitations/{id}/resend":{"post":{"operationId":"Invitations_resend","tags":["invitations"],"security":[{"session":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"x-required-scope":"members:write","x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Send an invitation again","description":"A new link. The old one stops working.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationSent"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invitations/accept":{"post":{"operationId":"Invitations_accept","tags":["invitations"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Accept an invitation","description":"Runs outside any workspace, since the invited person is not in one yet. Sign in with the address that was invited.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptInvitationInput"},"example":{"token":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvitationAccepted"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invitations/import":{"post":{"operationId":"Invitations_import","tags":["invitations"],"security":[{"session":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"x-required-scope":"members:write","x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Invite many people from CSV","description":"Send the CSV as text/plain, or as JSON with a `csv` field, with an Email column and an optional Role column.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportInput"},"example":{"csv":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invoices":{"get":{"operationId":"Invoices_list","tags":["invoices"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List invoices","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["DRAFT","SENT","VIEWED","PARTIALLY_PAID","PAID","VOID","OVERDUE"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Invoices_create","tags":["invoices"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create an invoice","description":"A draft, from lines typed here, tracked expenses pulled in by expenseIds, or both. Needs invoices turned on for this workspace.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoiceInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invoices/{id}":{"delete":{"operationId":"Invoices_remove","tags":["invoices"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a draft invoice","description":"Only a draft. Void one that has gone out, so its record stays.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Invoices_get","tags":["invoices"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get an invoice","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Invoices_update","tags":["invoices"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a draft invoice","description":"Only a draft. Undo the send first to change one that has gone out.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateInvoiceInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invoices/{id}/messages":{"post":{"operationId":"Invoices_addMessage","tags":["invoices"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Write on an invoice's conversation","description":"The recipient reads it at their link.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceMessageInput"},"example":{"body":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invoices/{id}/payments":{"post":{"operationId":"Invoices_recordPayment","tags":["invoices"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Record a payment or a refund","description":"A record of money that moved some other way. PaperTotal takes and sends no money.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordInvoicePaymentInput"},"example":{"amountMinor":1,"paidOn":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invoices/{id}/remind":{"post":{"operationId":"Invoices_remind","tags":["invoices"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Remind the recipient to pay","description":"Only while it waits for payment, and once an hour at most.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invoices/{id}/send":{"post":{"operationId":"Invoices_send","tags":["invoices"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Send an invoice","description":"By email, to its recipient and whoever it is shared with. A phone number alone cannot be sent to. Needs invoices turned on for this workspace.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invoices/{id}/undo-send":{"post":{"operationId":"Invoices_undoSend","tags":["invoices"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Take a sent invoice back","description":"Back to a draft, and its link stops working. Not once money is recorded against it.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invoices/{id}/void":{"post":{"operationId":"Invoices_void","tags":["invoices"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Void an invoice","description":"Not while payments stand on it: refund them first.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invoices/bulk":{"post":{"operationId":"Invoices_bulk","tags":["invoices"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create invoices from a CSV","description":"One invoice for each Send To and Report Name in the file, with a line for each row. Its first line names the columns: Send To, Share, Report Name, Merchant, Amount, Date, Due Date. A row already imported adds nothing. Needs invoices turned on for this workspace.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkInvoiceInput"},"example":{"csv":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkInvoiceResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/invoices/settings":{"get":{"operationId":"Invoices_settings","tags":["invoices"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Read the invoice settings","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Invoices_saveSettings","tags":["invoices"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change the invoice settings","description":"Turns invoices on or off, and sets what every invoice says about who sent it.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceSettingsInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/join-links":{"get":{"operationId":"JoinLinks_list","tags":["join-links"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List join links","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinLinkList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"JoinLinks_create","tags":["join-links"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a join link","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateJoinLinkInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinLink"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/join-links/{id}":{"delete":{"operationId":"JoinLinks_revoke","tags":["join-links"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Withdraw a join link","description":"Open on a lapsed plan: withdrawing access is never stopped.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/join-requests":{"get":{"operationId":"JoinRequests_list","tags":["join-requests"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List requests to join this workspace","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinRequestList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/join-requests/{id}":{"post":{"operationId":"JoinRequests_decide","tags":["join-requests"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Answer a request to join this workspace","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecideAccessInput"},"example":{"approve":false}}}},"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/join/email":{"post":{"operationId":"Join_email","tags":["join"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Send a code to prove another address","description":"Answers 202. An address on another account is refused.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinEmailInput"},"example":{"email":"someone@example.com"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinEmailSent"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/join/link":{"get":{"operationId":"Join_preview","tags":["join"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"See what a join link opens","description":"Needs no sign-in, so a link can say where it leads before anyone signs in.","parameters":[{"name":"token","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinLinkPreview"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Join_link","tags":["join"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Join through a join link","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedeemJoinLinkInput"},"example":{"token":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/join/options":{"get":{"operationId":"Join_options","tags":["join"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List the workspaces the caller could join","description":"From addresses they have proven and invitations waiting for them.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinOptions"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/join/verify":{"post":{"operationId":"Join_verify","tags":["join"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Prove another address with its code","description":"The address becomes a proven second address on this account, and that is what opens the workspaces on its domain.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinVerifyInput"},"example":{"email":"someone@example.com","code":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinOptions"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/join/workspaces/{id}":{"post":{"operationId":"Join_workspace","tags":["join"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Join a workspace the caller was offered","description":"A workspace not in the offer reads as missing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in":{"get":{"operationId":"Mailin_list","tags":["mail-in"],"security":[{"session":[]},{"apiKey":["mailin:read"]},{"oauth2":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List mail-in batches","description":"A member sees the batches they asked for.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInBatchPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Mailin_request","tags":["mail-in"],"security":[{"session":[]},{"apiKey":["mailin:write"]},{"oauth2":["mailin:write"]}],"x-required-scope":"mailin:write","x-required-feature":"mail_in","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Request envelopes and a mail-in batch","description":"`envelopes` is how many to send, and the answer says how many can still be requested this week. The estimate holds that many documents of this month's allowance. Both holds commit with the batch, or not at all. Left out, `afterScan` follows the workspace's shredding setting.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMailInInput"},"example":{"expectedDocuments":1}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInRequested"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/{id}":{"get":{"operationId":"Mailin_get","tags":["mail-in"],"security":[{"session":[]},{"apiKey":["mailin:read"]},{"oauth2":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a mail-in batch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInBatch"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Mailin_changeAddress","tags":["mail-in"],"security":[{"session":[]},{"apiKey":["mailin:write"]},{"oauth2":["mailin:write"]}],"x-required-scope":"mailin:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change the address on a batch","description":"For the person who asked or a manager, until the batch finishes. A batch's code cannot be changed.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeMailInAddressInput"},"example":{"shippingAddress":{"name":"string","line1":"string","city":"string","region":"string","postalCode":"string"}}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInBatch"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/{id}/barcode":{"get":{"operationId":"Mailin_batchBarcode","tags":["mail-in"],"security":[{"session":[]},{"apiKey":["mailin:read"]},{"oauth2":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a batch's barcode","description":"A Code 128 image of the batch reference.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"image/png":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/{id}/cancel":{"post":{"operationId":"Mailin_cancel","tags":["mail-in"],"security":[{"session":[]},{"apiKey":["mailin:write"]},{"oauth2":["mailin:write"]}],"x-required-scope":"mailin:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Cancel a batch nobody has started on","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInBatch"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/{id}/cover-sheet":{"get":{"operationId":"Mailin_batchCoverSheet","tags":["mail-in"],"security":[{"session":[]},{"apiKey":["mailin:read"]},{"oauth2":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a batch's cover sheet","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/{id}/documents":{"get":{"operationId":"Mailin_documents","tags":["mail-in"],"security":[{"session":[]},{"apiKey":["mailin:read"]},{"oauth2":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List what came out of a batch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInDocumentPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/allowance":{"get":{"operationId":"Mailin_allowance","tags":["mail-in"],"security":[{"session":[]},{"apiKey":["mailin:read"]},{"oauth2":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See this month's paper allowance","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInAllowance"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/barcode":{"get":{"operationId":"Mailin_barcode","tags":["mail-in"],"security":[{"session":[]},{"apiKey":["mailin:read"]},{"oauth2":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the workspace's barcode","description":"A Code 128 image of the workspace reference.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"image/png":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/cover-sheet":{"get":{"operationId":"Mailin_coverSheet","tags":["mail-in"],"security":[{"session":[]},{"apiKey":["mailin:read"]},{"oauth2":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the workspace's cover sheet","description":"One page to put on top of a stack of paper, with the barcode on it.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mail-in/settings":{"get":{"operationId":"Mailin_settings","tags":["mail-in"],"security":[{"session":[]},{"apiKey":["mailin:read"]},{"oauth2":["mailin:read"]}],"x-required-scope":"mailin:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See your saved mail-in address","description":"One person's own, in this workspace. Nobody else reads it.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Mailin_saveSettings","tags":["mail-in"],"security":[{"session":[]},{"apiKey":["mailin:write"]},{"oauth2":["mailin:write"]}],"x-required-scope":"mailin:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Save your mail-in address","description":"Envelopes and returned paper go here when a request names no address. Null forgets it. Batches already requested keep theirs: change those one at a time.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInSettingsInput"},"example":{"address":{"name":"string","line1":"string","city":"string","region":"string","postalCode":"string"}}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MailInSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me":{"delete":{"operationId":"AccountClosure_remove","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Close the caller's account","description":"Answers 202: the account closes now and the data follows after the grace period.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountInput"},"example":{"confirmEmail":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountDeletion"}}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Users_me","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Get the signed-in person and their workspaces","description":"The first verified token creates the person, a personal workspace, the default categories and a trial, so this is also the first call after sign-up. There is no sign-up route.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Users_update","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Change the signed-in person's profile","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProfileInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/clients":{"get":{"operationId":"ServedClients_list","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List the workspaces you serve","description":"Every workspace where you are an owner, admin or accountant, with what waits on it: expenses to review, reports to approve and pay, and unmatched card charges.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientWorkspaces"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/email-bounce/clear":{"post":{"operationId":"MeSecurity_clearBounce","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Clear the bounce on the caller's address","description":"Mail to it starts again.","parameters":[],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/forwarding-address":{"delete":{"operationId":"Users_removeAlias","tags":["me"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Give up the chosen forwarding address","description":"The random address keeps working. Only the chosen one stops.","parameters":[],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Users_chooseAlias","tags":["me"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Choose a forwarding address","description":"Beside the random one, which keeps working. A name someone else holds is refused.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForwardingAliasInput"},"example":{"alias":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForwardingAlias"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/forwarding-address/rotate":{"post":{"operationId":"Users_rotate","tags":["me"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Issue a new forwarding address","description":"The old address stops working the moment this one is issued.","parameters":[],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/invoices":{"get":{"operationId":"InvoicesToPay_list","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List invoices sent to you","description":"Found by your own verified email address or phone number, whoever sent them. Drafts and void invoices are left out.","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoicesToPay"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/merge":{"post":{"operationId":"MeSecurity_startMerge","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Start merging another account into this one","description":"Answers 202. A code goes to the other address.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartMergeInput"},"example":{"email":"someone@example.com"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeStarted"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/merge/confirm":{"post":{"operationId":"MeSecurity_confirmMerge","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Finish merging another account into this one","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmMergeInput"},"example":{"email":"someone@example.com","code":"string","otherToken":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountMerged"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/onboarding":{"post":{"operationId":"MeSecurity_onboarding","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Save what the person came for on first run","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingInput"},"example":{"intent":"BUSINESS"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/recovery-codes":{"get":{"operationId":"MeSecurity_recoveryStatus","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"See how many recovery codes are left","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryCodes"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"MeSecurity_issue","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Issue new recovery codes","description":"They are in this response and nowhere else, and the old ones stop working.","parameters":[],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecoveryCodesIssued"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/report-archives":{"get":{"operationId":"MeSecurity_archives","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List the caller's archived reports","description":"What is left to read of workspaces that closed.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportArchiveList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/report-archives/{id}":{"get":{"operationId":"MeSecurity_archive","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Read an archived report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportArchiveDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/report-suspicious":{"post":{"operationId":"MeSecurity_report","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Report suspicious activity","description":"Locks the account against changes until support unlocks it. Reading stays open.","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportSuspiciousInput"},"example":{}}}},"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/sessions":{"get":{"operationId":"MeSecurity_sessions","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List the caller's sessions","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/sessions/{id}":{"delete":{"operationId":"MeSecurity_revoke","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Sign one session out","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/sign-out-everywhere":{"post":{"operationId":"Account_signOutEverywhere","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Sign out everywhere","description":"Every session, and every app connected before now, stops on its next request.","parameters":[],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/travel-profile":{"get":{"operationId":"Account_travelProfile","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Read your travel profile","description":"Yours alone: no admin, manager or other workspace can read it. Document numbers come back as their last four.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelProfile"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Account_updateTravelProfile","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Change your travel profile","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTravelProfileInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelProfile"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/me/travel-profile/documents/{type}":{"delete":{"operationId":"Account_removeTravelDocument","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Remove a travel document","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Account_saveTravelDocument","tags":["me"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Save a travel document","description":"One of each kind: a passport, national ID, Known Traveler Number or Redress Number. The number is stored encrypted.","parameters":[{"name":"type","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveTravelDocumentInput"},"example":{"number":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelProfile"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/members":{"get":{"operationId":"Members_list","tags":["members"],"security":[{"session":[]},{"apiKey":["members:read"]},{"oauth2":["members:read"]}],"x-required-scope":"members:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List the members of this workspace","description":"Pay-adjacent fields stay empty unless the caller has members.manage.","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["ACTIVE","SUSPENDED"]}},{"name":"role","in":"query","required":false,"schema":{"type":"string","enum":["OWNER","ADMIN","APPROVER","ACCOUNTANT","AUDITOR","MEMBER","EDITOR","CARD_ADMIN","PEOPLE_ADMIN","PAYMENTS_ADMIN"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/members/{id}":{"delete":{"operationId":"Members_remove","tags":["members"],"security":[{"session":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"x-required-scope":"members:write","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Remove a member","description":"Their expenses stay. Anyone may remove their own membership. Taking access away works on a lapsed plan.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Members_get","tags":["members"],"security":[{"session":[]},{"apiKey":["members:read"]},{"oauth2":["members:read"]}],"x-required-scope":"members:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a member","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Members_update","tags":["members"],"security":[{"session":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"x-required-scope":"members:write","x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a member","description":"Only an owner can change an owner, or make someone an owner.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMemberInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Member"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/members/{id}/reset-2fa":{"post":{"operationId":"MemberSecurity_reset","tags":["members"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Reset a member's two-factor sign-in","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/members/{id}/sessions":{"get":{"operationId":"MemberSecurity_sessions","tags":["members"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a member's sessions","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/members/{id}/sessions/{sessionId}":{"delete":{"operationId":"MemberSecurity_revoke","tags":["members"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Sign one of a member's sessions out","description":"Open on a lapsed plan: taking access away is never stopped.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/members/bulk":{"post":{"operationId":"Members_bulk","tags":["members"],"security":[{"session":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"x-required-scope":"members:write","x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change many members at once","description":"A member the rules refuse stays as they were, and the rest still change.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkMemberInput"},"example":{"ids":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkMemberResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/members/provision":{"post":{"operationId":"Members_provisionPeople","tags":["members"],"security":[{"session":[]},{"apiKey":["members:write"]},{"oauth2":["members:write"]}],"x-required-scope":"members:write","x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Provision and remove people from a list","description":"From a request body or an https address, with a dry run. Answers with who was added, updated and removed, and who was skipped and why. A change of address needs a domain this workspace verified. SFTP is not offered.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisionResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/members/seats":{"get":{"operationId":"Members_seats","tags":["members"],"security":[{"session":[]},{"apiKey":["members:read"]},{"oauth2":["members:read"]}],"x-required-scope":"members:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See seats in use against the plan","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeatUsage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/merchants":{"get":{"operationId":"Merchants_list","tags":["merchants"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List merchants","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Merchants_create","tags":["merchants"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a merchant","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMerchantInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Merchant"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/merchants/{id}":{"get":{"operationId":"Merchants_get","tags":["merchants"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a merchant","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Merchant"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Merchants_update","tags":["merchants"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a merchant","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MerchantInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Merchant"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/merchants/{id}/aliases/{aliasId}":{"delete":{"operationId":"Merchants_removeAlias","tags":["merchants"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Remove a spelling from a merchant","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"aliasId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Merchant"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/merchants/{id}/merge":{"post":{"operationId":"Merchants_merge","tags":["merchants"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Merge another merchant into this one","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MergeMerchantInput"},"example":{"intoId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Merchant"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage":{"post":{"operationId":"Mileage_create","tags":["mileage"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-feature":"mileage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Record a trip","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTripInput"},"example":{"date":"string","origin":"string","destination":"string","purpose":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trip"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage-rates":{"get":{"operationId":"MileageRates_list","tags":["mileage-rates"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List mileage rates","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MileageRatePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"MileageRates_create","tags":["mileage-rates"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a mileage rate","description":"Rates are in hundredths of a cent per unit, so 72.5 cents is 7250.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MileageRateInput"},"example":{"name":"string","rateMinor":0}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MileageRate"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage-rates/{id}":{"delete":{"operationId":"MileageRates_remove","tags":["mileage-rates"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a mileage rate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"MileageRates_get","tags":["mileage-rates"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a mileage rate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MileageRate"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"MileageRates_update","tags":["mileage-rates"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a mileage rate","description":"A change to the amount, the start or the end clears `autoGenerated`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMileageRateInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MileageRate"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage-rates/settings":{"get":{"operationId":"MileageRates_settings","tags":["mileage-rates"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Read the distance settings","description":"Track tax, Require GPS or map entry, Exclude commutes and Auto-update government rate.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DistanceSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"MileageRates_updateSettings","tags":["mileage-rates"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change the distance settings","description":"Any Exclude commutes value but NONE holds Require GPS or map entry on. Turning Auto-update government rate on adds the rates at once.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDistanceSettingsInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DistanceSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/{id}":{"put":{"operationId":"Mileage_update","tags":["mileage"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-feature":"mileage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Replace a trip","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTripInput"},"example":{"date":"string","origin":"string","destination":"string","purpose":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trip"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/{id}/odometer-photos":{"post":{"operationId":"Mileage_attachPhoto","tags":["mileage"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-feature":"mileage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Attach an odometer photo to a trip","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"client","in":"query","required":false,"schema":{"description":"The app sending the file. Leave it out in a browser.","type":"string","enum":["ios","android"]}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file","reading"],"properties":{"file":{"type":"string","format":"binary"},"reading":{"type":"string","enum":["START","END"]}}},"example":{"reading":"START"}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"reading":{"type":"string","enum":["START","END"]}},"required":["uploadId","reading"]},"example":{"uploadId":"string","reading":"START"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Trip"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/commute":{"get":{"operationId":"Mileage_commute","tags":["mileage"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Read your commute","description":"What a workspace that excludes commutes takes off your trips.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Commute"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Mileage_saveCommute","tags":["mileage"],"security":[{"session":[]}],"x-required-feature":"mileage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Save your commute","description":"Your home address, as you type it on a trip, and the distance one way.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommuteInput"},"example":{"home":"string","distance":0}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Commute"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/log":{"get":{"operationId":"Mileage_log","tags":["mileage"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Read the mileage log","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","all"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"vehicleId","in":"query","required":false,"schema":{"type":"string"}},{"name":"purpose","in":"query","required":false,"schema":{"type":"string","enum":["business","medical","charity"]}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MileageLog"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/log/export":{"get":{"operationId":"Mileage_exportLog","tags":["mileage"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Export the mileage log","description":"The file comes back as JSON, with its content as text.","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","all"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"vehicleId","in":"query","required":false,"schema":{"type":"string"}},{"name":"purpose","in":"query","required":false,"schema":{"type":"string","enum":["business","medical","charity"]}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadableFile"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/places":{"get":{"operationId":"Mileage_places","tags":["mileage"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List saved places","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedPlaceList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Mileage_savePlace","tags":["mileage"],"security":[{"session":[]}],"x-required-feature":"mileage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Save a place","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedPlaceInput"},"example":{"name":"string","address":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedPlace"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/places/{id}":{"delete":{"operationId":"Mileage_deletePlace","tags":["mileage"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a saved place","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/route-estimate":{"post":{"operationId":"Mileage_estimateRoute","tags":["mileage"],"security":[{"session":[]}],"x-required-feature":"mileage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Estimate a route's distance","description":"Show `attribution` beside the figures. Each route has a `token`: send it back as `routeToken` with exactly that distance and those addresses, and the trip counts as measured by a map.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteEstimateInput"},"example":{"addresses":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteEstimate"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/route-service":{"get":{"operationId":"Mileage_routeService","tags":["mileage"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See whether route distances are available","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RouteService"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/routes":{"get":{"operationId":"Mileage_routes","tags":["mileage"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List saved routes","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TripRoutes"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/mileage/year":{"get":{"operationId":"Mileage_year","tags":["mileage"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Total the distance driven in a year","parameters":[{"name":"date","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"tripId","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MileageYear"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/notification-preferences":{"get":{"operationId":"NotificationSettings_preferences","tags":["notification-preferences"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Get notification preferences","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferenceList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"NotificationSettings_updatePreferences","tags":["notification-preferences"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Change notification preferences","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePreferencesInput"},"example":{"preferences":[{"type":"invoice.updated"}]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPreferenceList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/notifications":{"get":{"operationId":"Notifications_list","tags":["notifications"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List notifications","description":"With how many are unread.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/notifications/{id}/read":{"post":{"operationId":"Notifications_read","tags":["notifications"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Mark a notification as read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Notification"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/notifications/read-all":{"post":{"operationId":"Notifications_readAll","tags":["notifications"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Mark every notification as read","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatedCount"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/oauth/clients":{"get":{"operationId":"OAuthClients_list","tags":["oauth"],"security":[{"session":[]}],"x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List registered apps","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClientPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"OAuthClients_create","tags":["oauth"],"security":[{"session":[]}],"x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Register an app","description":"A confidential app has a secret. It is in this response and the rotate response, and nowhere else.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOAuthClientInput"},"example":{"name":"string","redirectUris":["string"],"scopes":["documents:read"]}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClientWithSecret"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/oauth/clients/{id}":{"delete":{"operationId":"OAuthClients_remove","tags":["oauth"],"security":[{"session":[]}],"x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Delete a registered app","description":"Open on a lapsed plan, like revoking a key.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"OAuthClients_get","tags":["oauth"],"security":[{"session":[]}],"x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a registered app","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClient"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"OAuthClients_update","tags":["oauth"],"security":[{"session":[]}],"x-required-permission":"developer.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a registered app","description":"Setting `enabled` to false stops every token this app holds on the next request.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateOAuthClientInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClient"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/oauth/clients/{id}/rotate-secret":{"post":{"operationId":"OAuthClients_rotate","tags":["oauth"],"security":[{"session":[]}],"x-required-permission":"developer.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Issue a new client secret","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClientWithSecret"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/oauth/connections":{"get":{"operationId":"OAuthConsent_connections","tags":["oauth"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List the apps connected to the caller's account","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthConnectionPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/oauth/connections/{id}":{"delete":{"operationId":"OAuthConsent_disconnect","tags":["oauth"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Disconnect an app","description":"Open on a lapsed plan and for any role: nobody should have to pay to cut an app off.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/oauth/consent":{"get":{"operationId":"OAuthConsent_consent","tags":["oauth"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Read what an app is asking for","description":"For the consent screen. `request` is the value /oauth/authorize put on the address.","parameters":[{"name":"request","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":8000}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthConsent"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"OAuthConsent_approve","tags":["oauth"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Approve an app","description":"Answers with where to send the browser next. `scopes` may only narrow what was asked for.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthConsentInput"},"example":{"request":"string","workspaceId":"string","scopes":["documents:read"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthRedirect"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/oauth/consent/deny":{"post":{"operationId":"OAuthConsent_deny","tags":["oauth"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Refuse an app","description":"Answers with where to send the browser next.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthDenyInput"},"example":{"request":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthRedirect"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/parse":{"get":{"operationId":"Parse_list","tags":["parse"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List documents turned into Markdown","parameters":[{"name":"details","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParsedDocumentPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Parse_create","tags":["parse"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Turn a document into Markdown","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Tables and reading order are kept. details adds a box for each line, and meta holds pages, sharpness and OCR scores. Up to 50 pages.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"details":{"type":"boolean"}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"details":{"type":"boolean"}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParsedDocument"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/parse-set":{"get":{"operationId":"DocumentSets_listParseSets","tags":["parse-set"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List Markdown sets","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSetPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentSets_createParseSet","tags":["parse-set"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Split a PDF and turn each document in it into Markdown","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Up to 50 MB. Answers at once.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/parse-set/{id}":{"get":{"operationId":"DocumentSets_getParseSet","tags":["parse-set"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a Markdown set","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/parse/{id}":{"delete":{"operationId":"Parse_remove","tags":["parse"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete one","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Parse_get","tags":["parse"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a document as Markdown","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"details","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParsedDocument"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Parse_update","tags":["parse"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change the title, notes or tags of one","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParseUpdateInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParsedDocument"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/parse/async":{"post":{"operationId":"Parse_createAsync","tags":["parse"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Turn a document into Markdown, in the background","description":"Answers at once. document.processed says when it is done.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"details":{"type":"boolean"}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"details":{"type":"boolean"}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParsedDocument"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/payment-accounts":{"get":{"operationId":"PaymentAccounts_list","tags":["payment-accounts"],"security":[{"session":[]},{"apiKey":["cards:read"]},{"oauth2":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List cards and bank accounts","description":"A member sees their own and those of the people reporting to them. Numbers are last four only.","parameters":[{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentAccountPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"PaymentAccounts_create","tags":["payment-accounts"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a card or bank account","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentAccountInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentAccount"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/payment-accounts/{id}":{"delete":{"operationId":"PaymentAccounts_remove","tags":["payment-accounts"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a card or bank account","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"PaymentAccounts_get","tags":["payment-accounts"],"security":[{"session":[]},{"apiKey":["cards:read"]},{"oauth2":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a card or bank account","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentAccount"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"PaymentAccounts_update","tags":["payment-accounts"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a card or bank account","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePaymentAccountInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentAccount"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/payment-accounts/{id}/assign":{"post":{"operationId":"PaymentAccounts_assign","tags":["payment-accounts"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Assign a card to a member","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignCardInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentAccount"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/payment-accounts/{id}/import":{"post":{"operationId":"PaymentAccounts_import","tags":["payment-accounts"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import a statement for one card","description":"A statement imported twice adds nothing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"force":{"type":"string"},"createExpenses":{"type":"string"},"reimbursable":{"type":"string"},"mapping":{"description":"The column mapping, as JSON text. Leave it out to use the suggested one. OFX and QFX need none.","type":"string"}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"force":{"type":"string"},"createExpenses":{"type":"string"},"reimbursable":{"type":"string"},"mapping":{"description":"The column mapping, as JSON text. Leave it out to use the suggested one. OFX and QFX need none.","type":"string"}},"required":["uploadId"]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatementImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/payment-accounts/{id}/import/preview":{"post":{"operationId":"PaymentAccounts_preview","tags":["payment-accounts"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Preview a statement for one card","description":"Reads the file and stores nothing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"mapping":{"description":"The column mapping, as JSON text. Leave it out to use the suggested one. OFX and QFX need none.","type":"string"}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"mapping":{"description":"The column mapping, as JSON text. Leave it out to use the suggested one. OFX and QFX need none.","type":"string"}},"required":["uploadId"]},"example":{"uploadId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatementPreview"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/payment-accounts/{id}/statements":{"get":{"operationId":"PaymentAccounts_statements","tags":["payment-accounts"],"security":[{"session":[]},{"apiKey":["cards:read"]},{"oauth2":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a card's statement periods","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CardStatements"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/payment-accounts/bulk":{"post":{"operationId":"PaymentAccounts_bulk","tags":["payment-accounts"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change many cards at once","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkPaymentAccountInput"},"example":{"ids":["string"],"action":"unassign"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkPaymentAccountResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/payment-accounts/export":{"get":{"operationId":"PaymentAccounts_exportList","tags":["payment-accounts"],"security":[{"session":[]},{"apiKey":["cards:read"]},{"oauth2":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Export the card table","description":"The file comes back as JSON, with its content as text.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadableFile"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/payment-accounts/import-feed":{"post":{"operationId":"PaymentAccounts_importFeed","tags":["payment-accounts"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import a statement file holding many cards","description":"Each row goes to its own card. A card new to this workspace is created.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"force":{"type":"string"},"createExpenses":{"type":"string"},"reimbursable":{"type":"string"},"mapping":{"description":"The column mapping, as JSON text. Leave it out to use the suggested one. OFX and QFX need none.","type":"string"}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"force":{"type":"string"},"createExpenses":{"type":"string"},"reimbursable":{"type":"string"},"mapping":{"description":"The column mapping, as JSON text. Leave it out to use the suggested one. OFX and QFX need none.","type":"string"}},"required":["uploadId"]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatementFeedImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/payment-accounts/import-feed/preview":{"post":{"operationId":"PaymentAccounts_previewFeed","tags":["payment-accounts"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Preview a statement file holding many cards","description":"Reads the file and stores nothing. Each row names its own card.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"mapping":{"description":"The column mapping, as JSON text. Leave it out to use the suggested one. OFX and QFX need none.","type":"string"}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"mapping":{"description":"The column mapping, as JSON text. Leave it out to use the suggested one. OFX and QFX need none.","type":"string"}},"required":["uploadId"]},"example":{"uploadId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatementPreview"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/payment-accounts/import-template":{"get":{"operationId":"PaymentAccounts_importTemplate","tags":["payment-accounts"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Download the card import template","description":"The file comes back as JSON, with its content as text.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadableFile"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/people-sync":{"get":{"operationId":"PeopleSync_view","tags":["people-sync"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See the HR connection","description":"The systems on offer, this workspace's connection if it has one, and its recent runs.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeopleSync"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/people-sync/complete-setup":{"post":{"operationId":"PeopleSync_completeSetup","tags":["people-sync"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Finish setting up the HR connection","description":"Runs the first import. A file connection starts waiting for its first file.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeopleSync"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/people-sync/connection":{"delete":{"operationId":"PeopleSync_disconnect","tags":["people-sync"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Disconnect the HR system","description":"Everyone it added stays, and the lock it put on approvals lifts.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"PeopleSync_connect","tags":["people-sync"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Connect an HR system","description":"With the credentials that system asks for, which are tried against it before anything is saved. One HR system per workspace. For a file connection, the answer carries the token behind the file drop and webhook, once.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectHrInput"},"example":{"system":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HrConnected"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/people-sync/drop/{token}":{"put":{"operationId":"PeopleSync_drop","tags":["people-sync"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Drop an HR export at its address","description":"For a scheduled job: curl -T export.csv to this address. A drop is everyone, so anyone it leaves out has left. Needs no sign-in: the token in the address, shown once when the HR system was connected, is the credential. Nothing imports until setup is complete.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"text/csv":{"schema":{"type":"string","description":"The CSV itself, as the whole body, up to 10 MB."}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeopleSyncRun"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/people-sync/import":{"post":{"operationId":"PeopleSync_importFile","tags":["people-sync"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import people from a file","description":"A CSV sent first to POST /v1/uploads, read once and not kept. With complete, anyone the file leaves out has left.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportPeopleFileInput"},"example":{"uploadId":"00000000-0000-7000-8000-000000000000"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeopleSyncRun"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/people-sync/settings":{"patch":{"operationId":"PeopleSync_updateSettings","tags":["people-sync"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change how the HR system sets approvers","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateHrSettingsInput"},"example":{"approvalMode":"BASIC"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeopleSync"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/people-sync/sync":{"post":{"operationId":"PeopleSync_sync","tags":["people-sync"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Sync people now","description":"Up to 2 times in 24 hours. The daily sync runs whatever the count.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeopleSync"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/people-sync/webhook/{token}":{"post":{"operationId":"PeopleSync_webhook","tags":["people-sync"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Send people from your own system","description":"A list of people as JSON. With complete, anyone it leaves out has left. Needs no sign-in: the token in the address, shown once when the HR system was connected, is the credential. Nothing imports until setup is complete.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeopleWebhookInput"},"example":{"people":[{"externalId":"string"}]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeopleSyncRun"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/per-diem":{"post":{"operationId":"PerDiem_create","tags":["per-diem"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-feature":"per_diem","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Record a per diem","description":"Meals and lodging file as separate expenses, so each deducts at its own percentage.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePerDiemInput"},"example":{"startDate":"string","endDate":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetails"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/per-diem-rates":{"get":{"operationId":"PerDiemRates_list","tags":["per-diem-rates"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List per diem rates","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemRatePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"PerDiemRates_create","tags":["per-diem-rates"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"per_diem","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a per diem rate","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemRateInput"},"example":{"name":"string","amountMinor":0}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemRate"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/per-diem-rates/{id}":{"delete":{"operationId":"PerDiemRates_remove","tags":["per-diem-rates"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"per_diem","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a per diem rate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"PerDiemRates_get","tags":["per-diem-rates"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a per diem rate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemRate"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"PerDiemRates_update","tags":["per-diem-rates"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"per_diem","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a per diem rate","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePerDiemRateInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemRate"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/per-diem-rates/bulk":{"post":{"operationId":"PerDiemRates_bulk","tags":["per-diem-rates"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"per_diem","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change or delete several per diem rates","description":"All of them or none: an id that is not in this workspace stops the whole request with a 404.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkPerDiemInput"},"example":{"ids":["string"],"action":"update"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkPerDiemResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/per-diem-rates/export":{"get":{"operationId":"PerDiemRates_export","tags":["per-diem-rates"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Download per diem rates as CSV","description":"The file comes back as JSON, with its content as text, in the columns the import reads.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadableFile"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/per-diem-rates/import":{"post":{"operationId":"PerDiemRates_import","tags":["per-diem-rates"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"per_diem","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import per diem rates from CSV","description":"Send the CSV as text/plain, or as JSON with a `csv` field.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportInput"},"example":{"csv":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/per-diem-rates/settings":{"get":{"operationId":"PerDiemRates_settings","tags":["per-diem-rates"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Read the per diem settings","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"PerDiemRates_updateSettings","tags":["per-diem-rates"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"per_diem","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Set the default per diem category","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePerDiemSettingsInput"},"example":{"defaultCategoryId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/per-diem-rates/templates":{"post":{"operationId":"PerDiemRates_template","tags":["per-diem-rates"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"per_diem","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add per diem rates from a country template","description":"Adds the rates, or puts ones already in the list back to the figures. Nobody has checked these figures against the authority yet.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerDiemTemplateInput"},"example":{"template":"DE"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/personal-rules":{"get":{"operationId":"PersonalRules_list","tags":["personal-rules"],"security":[{"session":[]},{"apiKey":["rules:read"]},{"oauth2":["rules:read"]}],"x-required-scope":"rules:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a person's rules","description":"The caller's own, or with ownerId, an employee's. Naming someone else needs policies.manage.","parameters":[{"name":"ownerId","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRuleList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"PersonalRules_create","tags":["personal-rules"],"security":[{"session":[]},{"apiKey":["rules:write"]},{"oauth2":["rules:write"]}],"x-required-scope":"rules:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a rule for a person","description":"For the caller, or with ownerId, for an employee. It runs on what that person spends, and can set tags and billable.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalRuleInput"},"example":{"name":"string","merchantContains":"string","actions":{}}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRule"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/personal-rules/{id}":{"delete":{"operationId":"PersonalRules_remove","tags":["personal-rules"],"security":[{"session":[]},{"apiKey":["rules:write"]},{"oauth2":["rules:write"]}],"x-required-scope":"rules:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a person's rule","description":"Name the person with ownerId when the rule is not the caller's.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"PersonalRules_update","tags":["personal-rules"],"security":[{"session":[]},{"apiKey":["rules:write"]},{"oauth2":["rules:write"]}],"x-required-scope":"rules:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a person's rule","description":"Name the person with ownerId when the rule is not the caller's.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PersonalRuleInput"},"example":{"name":"string","merchantContains":"string","actions":{}}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRule"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/personal-rules/{id}/apply":{"post":{"operationId":"PersonalRules_apply","tags":["personal-rules"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Run the caller's own rule over their unsubmitted expenses","description":"A field the caller set by hand stays as it is.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationApply"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/personal-rules/{id}/test":{"post":{"operationId":"PersonalRules_test","tags":["personal-rules"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Count what the caller's own rule would match","description":"Across the caller's own expenses. Changes nothing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationPreview"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/personal-rules/reorder":{"post":{"operationId":"PersonalRules_reorder","tags":["personal-rules"],"security":[{"session":[]},{"apiKey":["rules:write"]},{"oauth2":["rules:write"]}],"x-required-scope":"rules:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Put the caller's own rules in a new order","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderAutomationRulesInput"},"example":{"ids":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutomationRuleOrder"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/plaid/exchange":{"post":{"operationId":"Plaid_exchange","tags":["plaid"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Finish linking a bank","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaidExchangeInput"},"example":{"publicToken":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaidItem"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/plaid/items":{"get":{"operationId":"Plaid_items","tags":["plaid"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List linked banks","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaidItemList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/plaid/items/{id}":{"delete":{"operationId":"Plaid_remove","tags":["plaid"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Unlink a bank","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Plaid_rename","tags":["plaid"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Rename a linked bank","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenamePlaidItemInput"},"example":{"institutionName":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaidItem"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/plaid/items/{id}/link-token":{"post":{"operationId":"Plaid_fixToken","tags":["plaid"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Start signing in to a bank again","description":"Link in update mode, for a connection that needs the person to sign in again.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaidLinkToken"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/plaid/items/{id}/reconnected":{"post":{"operationId":"Plaid_reconnected","tags":["plaid"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Finish signing in to a bank again","description":"Link finished in update mode: the same connection, signed in again.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaidItem"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/plaid/items/{id}/refresh-accounts":{"post":{"operationId":"Plaid_refreshAccounts","tags":["plaid"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Bring in cards the bank has added","description":"They come in as new accounts, and nothing else moves.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaidItem"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/plaid/items/{id}/share":{"post":{"operationId":"Plaid_share","tags":["plaid"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Move a linked bank's accounts to another workspace","description":"To a workspace the caller manages. No transaction is copied.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SharePlaidItemInput"},"example":{"workspaceId":"string","paymentAccountIds":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaidItem"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/plaid/items/{id}/sync":{"post":{"operationId":"Plaid_sync","tags":["plaid"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Sync a linked bank now","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaidItem"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/plaid/link-token":{"post":{"operationId":"Plaid_linkToken","tags":["plaid"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Start linking a bank","description":"The token opens Plaid Link.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaidLinkToken"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/plaid/status":{"get":{"operationId":"Plaid_status","tags":["plaid"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See whether bank linking is available","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlaidStatus"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/policies":{"get":{"operationId":"Policies_list","tags":["policies"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List policy rules","description":"Name a tab to list the rules on that tab of the rules screen.","parameters":[{"name":"tab","in":"query","required":false,"schema":{"type":"string","enum":["general","cards","fields","flags"]}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRuleList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Policies_create","tags":["policies"],"security":[{"session":[]}],"x-required-permission":"policies.manage","x-required-feature":"policies","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a policy rule","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRuleInput"},"example":{"type":"MAX_AMOUNT"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRule"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/policies/{id}":{"delete":{"operationId":"Policies_remove","tags":["policies"],"security":[{"session":[]}],"x-required-permission":"policies.manage","x-required-feature":"policies","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a policy rule","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Policies_update","tags":["policies"],"security":[{"session":[]}],"x-required-permission":"policies.manage","x-required-feature":"policies","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a policy rule","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePolicyRuleInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRule"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/profile/photo":{"delete":{"operationId":"Profile_removePhoto","tags":["profile"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Remove your profile photo","parameters":[],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Profile_setPhoto","tags":["profile"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Set your profile photo","description":"Send the image to POST /v1/uploads with the purpose profile_photo first. The photo is yours across every workspace.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfilePhotoInput"},"example":{"uploadId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfilePhoto"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/profile/private":{"put":{"operationId":"Profile_save","tags":["profile"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Save your private details","description":"With the unlockToken from opening them, before it runs out.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavePrivateDetailsInput"},"example":{"unlockToken":"string","details":{"legalFirstName":"string","legalLastName":"string","dateOfBirth":"2026-01-31","phone":"string","addressLine1":"string","addressLine2":"string","city":"string","region":"string","postalCode":"string","country":"string"}}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivateDetailsSaved"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/profile/private/code":{"post":{"operationId":"Profile_sendCode","tags":["profile"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Email a code that opens your private details","description":"Your legal name, date of birth, a personal phone and a home address, kept sealed. The code goes to the address you sign in with, three an hour at most, and a new one replaces the last.","parameters":[],"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivateDetailsCodeSent"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/profile/private/unlock":{"post":{"operationId":"Profile_unlock","tags":["profile"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Open your private details with the emailed code","description":"Your legal name, date of birth, a personal phone and a home address, kept sealed.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnlockPrivateDetailsInput"},"example":{"code":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivateDetailsUnlocked"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/projects":{"get":{"operationId":"Projects_list","tags":["projects"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List projects","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"clientId","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Projects_create","tags":["projects"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a project","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/projects/{id}":{"delete":{"operationId":"Projects_remove","tags":["projects"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a project","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Projects_get","tags":["projects"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a project","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Projects_update","tags":["projects"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a project","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProjectInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/projects/import":{"post":{"operationId":"Projects_import","tags":["projects"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import projects from CSV","description":"Send the CSV as text/plain, or as JSON with a `csv` field. Rows that match an existing project update it.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportInput"},"example":{"csv":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/public-receipts/{token}":{"get":{"operationId":"PublicReceipts_read","tags":["public-receipts"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Open a public receipt","description":"Needs no sign-in: the signed link is the whole of the access, and it works only while the workspace has public receipts on.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicReceipt"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/public/invoices/{token}":{"get":{"operationId":"PublicInvoices_read","tags":["public"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Read an invoice by its link","description":"Needs no sign-in: the token in the link is the whole of the access. The first read marks it viewed, and the sender hears.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicInvoice"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/public/invoices/{token}/messages":{"post":{"operationId":"PublicInvoices_message","tags":["public"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Write on an invoice's conversation by its link","description":"Needs no sign-in: the token in the link is the whole of the access.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceMessageInput"},"example":{"body":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicInvoice"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/public/report-approvals/{token}":{"get":{"operationId":"ApprovalLinks_read","tags":["public"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Read a report sent for approval by link","description":"Needs no sign-in: the token in the link is the whole of the access, and it opens this one report. A wrong or expired token is a 404.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportApprovalLink"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/public/report-approvals/{token}/approve":{"post":{"operationId":"ApprovalLinks_approve","tags":["public"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Approve a report by its link","description":"Only while the link is OPEN. Needs no sign-in: the token in the link is the whole of the access, and it opens this one report. A wrong or expired token is a 404.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportApprovalLink"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/public/report-approvals/{token}/paid":{"post":{"operationId":"ApprovalLinks_paid","tags":["public"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Say a report approved by its link was paid","description":"Only once it is APPROVED. The link is then SETTLED and shows no figures. Needs no sign-in: the token in the link is the whole of the access, and it opens this one report. A wrong or expired token is a 404.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportApprovalLink"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/public/report-approvals/{token}/reject":{"post":{"operationId":"ApprovalLinks_reject","tags":["public"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Reject a report by its link","description":"Only while the link is OPEN. The reason goes to the person who sent it. Needs no sign-in: the token in the link is the whole of the access, and it opens this one report. A wrong or expired token is a 404.","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutsideDecisionInput"},"example":{"reason":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportApprovalLink"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reference/countries":{"get":{"operationId":"Reference_countries","tags":["reference"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List country codes and the currency each prints","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferenceCountryPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reference/currencies":{"get":{"operationId":"Reference_currencies","tags":["reference"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List currency codes","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferenceCurrencyPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reference/locales":{"get":{"operationId":"Reference_locales","tags":["reference"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List the locales offered in a picker","description":"A workspace can hold any language tag; these are the usual ones.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferenceLocalePage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reference/system-categories":{"get":{"operationId":"Reference_systemCategories","tags":["reference"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List the categories a new workspace starts with","description":"A workspace's own are at GET /v1/categories.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferenceSystemCategoryPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements":{"get":{"operationId":"Reimbursements_list","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List reimbursement batches","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["PENDING","PROCESSING","PAID","FAILED","CANCELLED"]}},{"name":"payeeId","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReimbursementPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Reimbursements_create","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-required-feature":"reimbursements","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create reimbursement batches","description":"Answers with one batch per person paid.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReimbursementInput"},"example":{"reportIds":["string"]}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReimbursementList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/{id}":{"get":{"operationId":"Reimbursements_get","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a reimbursement batch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reimbursement"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/{id}/cancel":{"post":{"operationId":"Reimbursements_cancel","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-required-feature":"reimbursements","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Cancel a batch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reimbursement"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/{id}/confirm-received":{"post":{"operationId":"Reimbursements_confirmReceived","tags":["reimbursements"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Confirm the money arrived","description":"The payee says so. No role needed: it is their money.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reimbursement"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/{id}/mark-failed":{"post":{"operationId":"Reimbursements_markFailed","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-required-feature":"reimbursements","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Mark a batch as failed","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailReimbursementInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reimbursement"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/{id}/mark-paid":{"post":{"operationId":"Reimbursements_markPaid","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-required-feature":"reimbursements","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Mark a batch as paid","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkReimbursementPaidInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reimbursement"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/exports/aba":{"post":{"operationId":"Reimbursements_aba","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Build an ABA file","description":"The file comes back as JSON, with its content as text.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AbaExportInput"},"example":{"ids":["string"],"processOn":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AbaFile"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/exports/details":{"post":{"operationId":"Reimbursements_details","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Download who is owed what, with their bank details","description":"Approved reports only, and only once a workspace has added this export. Account and routing numbers show their last four digits unless fullNumbers is sent by someone who may reveal them, which is audited. The file comes back as JSON, with its content as text, and no copy is kept.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReimbursementDetailsInput"},"example":{"reportIds":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadableFile"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/exports/nacha":{"post":{"operationId":"Reimbursements_nacha","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Build a NACHA file","description":"The file comes back as JSON, with its content as text.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NachaExportInput"},"example":{"ids":["string"],"effectiveDate":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NachaFile"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/exports/payroll":{"get":{"operationId":"Reimbursements_payroll","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Export what is owed for payroll","description":"The file comes back as JSON, with its content as text.","parameters":[{"name":"ids","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadableFile"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/mine":{"get":{"operationId":"Reimbursements_mine","tags":["reimbursements"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List the caller's own reimbursements","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReimbursementPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/my-bank-account":{"delete":{"operationId":"Reimbursements_removeMyBankAccount","tags":["reimbursements"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Remove the caller's own bank account","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Reimbursements_myBankAccount","tags":["reimbursements"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the caller's own bank account","description":"No role needed to say where your own money goes.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyBankAccount"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Reimbursements_setMyBankAccount","tags":["reimbursements"],"security":[{"session":[]}],"x-required-feature":"reimbursements","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Set the caller's own bank account","description":"A workspace based in AUD sends a BSB and an account number, and every other workspace a routing and an account number.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayeeAccountInput"},"example":{"holderName":"string","routingNumber":"string","accountNumber":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayeeBankAccount"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/originator":{"get":{"operationId":"Reimbursements_originator","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the ACH originator details","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AchOriginatorSetting"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Reimbursements_setOriginator","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-required-feature":"reimbursements","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Set the ACH originator details","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AchOriginatorInput"},"example":{"bankRoutingNumber":"string","bankName":"string","companyName":"string","companyId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AchOriginator"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/originator/aba":{"get":{"operationId":"Reimbursements_abaOriginator","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the ABA originator details","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AbaOriginatorSetting"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Reimbursements_setAbaOriginator","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-required-feature":"reimbursements","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Set the ABA originator details","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AbaOriginatorInput"},"example":{"bankCode":"string","userName":"string","userId":"string","bsb":"string","accountNumber":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AbaOriginator"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/outstanding":{"get":{"operationId":"Reimbursements_outstanding","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See what is owed, by person","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Outstanding"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/payee-accounts":{"get":{"operationId":"Reimbursements_payeeAccounts","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List members' bank accounts","description":"Numbers are masked.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayeeBankAccountList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/payee-accounts/{userId}":{"delete":{"operationId":"Reimbursements_removePayeeAccount","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Remove a member's bank account","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Reimbursements_setPayeeAccount","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-required-feature":"reimbursements","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Set a member's bank account","description":"A workspace based in AUD sends a BSB and an account number, and every other workspace a routing and an account number.","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayeeAccountInput"},"example":{"holderName":"string","routingNumber":"string","accountNumber":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayeeBankAccount"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reimbursements/settings":{"get":{"operationId":"Reimbursements_settings","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the reimbursement settings","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReimbursementSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Reimbursements_saveSettings","tags":["reimbursements"],"security":[{"session":[]}],"x-required-permission":"reimbursements.manage","x-required-feature":"reimbursements","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change the reimbursement settings","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReimbursementSettingsInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReimbursementSettings"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/release-notifications":{"get":{"operationId":"ReleaseNotes_list","tags":["release-notifications"],"security":[{"session":[]},{"apiKey":[]},{"oauth2":[]}],"x-required-scope":"any_credential","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List release notes","description":"Versioned notes on what changed, newest first. Any key or token may read them, whatever its scopes.","parameters":[{"name":"product","in":"query","required":false,"schema":{"type":"string","enum":["app_web","api","mcp","model_document_extraction","model_bank_statements","model_checks","model_fraud_detection"]}},{"name":"environment","in":"query","required":false,"schema":{"type":"string","enum":["production","sandbox"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseNotePage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/release-subscriptions":{"get":{"operationId":"ReleaseSubscriptions_list","tags":["release-subscriptions"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List who hears about releases","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseSubscriptionPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/release-subscriptions/{userId}":{"delete":{"operationId":"ReleaseSubscriptions_unsubscribe","tags":["release-subscriptions"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Stop someone hearing about releases","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"ReleaseSubscriptions_subscribe","tags":["release-subscriptions"],"security":[{"session":[]}],"x-required-permission":"members.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Choose how someone hears about releases","parameters":[{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseSubscriptionInput"},"example":{"products":["app_web"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseSubscription"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/report-catalog":{"get":{"operationId":"ReportCatalog_list","tags":["report-catalog"],"security":[{"session":[]}],"x-required-permission":"expenses.read_all","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List the ready-made reports","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogReportList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/report-catalog/{key}":{"get":{"operationId":"ReportCatalog_report","tags":["report-catalog"],"security":[{"session":[]}],"x-required-permission":"expenses.read_all","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Run one ready-made report","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogReport"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/report-catalog/{key}/export":{"get":{"operationId":"ReportCatalog_export","tags":["report-catalog"],"security":[{"session":[]}],"x-required-permission":"expenses.read_all","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Download one ready-made report as CSV","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/report-fields":{"get":{"operationId":"ReportFields_list","tags":["report-fields"],"security":[{"session":[]},{"apiKey":["workspace:read"]},{"oauth2":["workspace:read"]}],"x-required-scope":"workspace:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List report fields","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportFieldList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ReportFields_create","tags":["report-fields"],"security":[{"session":[]},{"apiKey":["workspace:write"]},{"oauth2":["workspace:write"]}],"x-required-scope":"workspace:write","x-required-permission":"settings.manage","x-required-feature":"custom_fields","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a report field","description":"TEXT, DATE, LIST for a dropdown, or FORMULA.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportFieldInput"},"example":{"name":"string","type":"TEXT"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportField"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/report-fields/{id}":{"delete":{"operationId":"ReportFields_remove","tags":["report-fields"],"security":[{"session":[]},{"apiKey":["workspace:write"]},{"oauth2":["workspace:write"]}],"x-required-scope":"workspace:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a report field","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"ReportFields_update","tags":["report-fields"],"security":[{"session":[]},{"apiKey":["workspace:write"]},{"oauth2":["workspace:write"]}],"x-required-scope":"workspace:write","x-required-permission":"settings.manage","x-required-feature":"custom_fields","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a report field","description":"Name and type stay as they were created, since reports already hold values by them.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateReportFieldInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportField"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/report-fields/turn-off":{"post":{"operationId":"ReportFields_turnOff","tags":["report-fields"],"security":[{"session":[]},{"apiKey":["workspace:write"]},{"oauth2":["workspace:write"]}],"x-required-scope":"workspace:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Turn report fields off","description":"Lists are kept and turned off, and the rest are deleted.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportFieldsOff"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports":{"get":{"operationId":"Reports_list","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:read"]},{"oauth2":["reports:read"]}],"x-required-scope":"reports:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List reports","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","enum":["DRAFT","SUBMITTED","APPROVED","REJECTED","REIMBURSED","EXPORTED","CLOSED"]},{"type":"array","items":{"type":"string","enum":["DRAFT","SUBMITTED","APPROVED","REJECTED","REIMBURSED","EXPORTED","CLOSED"]}}]}},{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","all","assigned"]}},{"name":"ownerId","in":"query","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Reports_create","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a report","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateReportInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}":{"delete":{"operationId":"Reports_remove","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a draft report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Reports_get","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:read"]},{"oauth2":["reports:read"]}],"x-required-scope":"reports:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Reports_update","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateReportInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/accept-findings":{"post":{"operationId":"Reports_acceptFindings","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Accept what the receipt checks found","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/approve":{"post":{"operationId":"Reports_approve","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Approve a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApproveReportInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/close":{"post":{"operationId":"Reports_close","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Close a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/comments":{"get":{"operationId":"ReportComments_list","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:read"]},{"oauth2":["reports:read"]}],"x-required-scope":"reports:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List comments on a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ReportComments_add","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Comment on a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostedComment"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/comments/{commentId}/reach":{"post":{"operationId":"ReportComments_reach","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Reach someone a comment on this report could not","description":"The author adds them to the report, and then they are told.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"commentId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReachMentionedInput"},"example":{"userIds":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reached"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/comments/mentionable":{"get":{"operationId":"ReportComments_mentionable","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:read"]},{"oauth2":["reports:read"]}],"x-required-scope":"reports:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List who a comment on this report can mention","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MentionablePeople"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/duplicate":{"post":{"operationId":"Reports_duplicate","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Start a new report from this one","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/expenses":{"post":{"operationId":"Reports_addExpenses","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add expenses to a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportExpensesInput"},"example":{"ids":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/expenses/{expenseId}":{"delete":{"operationId":"Reports_removeExpense","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Take an expense off a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expenseId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/expenses/{expenseId}/reject":{"post":{"operationId":"Reports_rejectExpense","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Reject one expense on a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expenseId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectExpenseInput"},"example":{"reason":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/mark-exported":{"post":{"operationId":"Reports_markExported","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Mark a report as exported","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/mark-reimbursed":{"post":{"operationId":"Reports_markReimbursed","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Mark a report as reimbursed","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/move":{"post":{"operationId":"ReportMove_move","tags":["reports"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Move a draft report to another workspace","description":"For its owner, who has to belong to both. Its expenses, receipts and comments go with it under new numbers. Categories and tags carry over by name. A charge on a card here, anything posted to the books or split apart stays, and the answer says why.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoveReportInput"},"example":{"workspaceId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportMoved"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/participants":{"post":{"operationId":"Reports_invite","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Add a person to a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportParticipantInput"},"example":{"userId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/participants/{userId}":{"delete":{"operationId":"Reports_uninvite","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Take a person off a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/reassign":{"post":{"operationId":"Reports_reassign","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Hand a report to another approver","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReassignReportInput"},"example":{"approverId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/received-payment":{"post":{"operationId":"Reports_receivedPayment","tags":["reports"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Say the payment for a report has arrived","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/reject":{"post":{"operationId":"Reports_reject","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Send a report back","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RejectReportInput"},"example":{"reason":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/reopen":{"post":{"operationId":"Reports_reopen","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Reopen a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/retract":{"post":{"operationId":"Reports_retract","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Take a submitted report back","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/submit":{"post":{"operationId":"Reports_submit","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Submit a report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitReportInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/{id}/submit-via-pdf":{"post":{"operationId":"Reports_submitViaPdf","tags":["reports"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Submit a report and make a PDF that can approve it","description":"For an approver outside PaperTotal. The PDF is made by an export, which exportJobId names.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportSubmittedViaPdf"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/bulk-reassign":{"post":{"operationId":"Reports_bulkReassign","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Hand many reports to another approver","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReassignInput"},"example":{"reportIds":["string"],"approverId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/bulk-submit":{"post":{"operationId":"Reports_bulkSubmit","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Submit many reports","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReportsInput"},"example":{"reportIds":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/lookup":{"get":{"operationId":"Reports_lookup","tags":["reports"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Find a report by the ID printed on it","description":"Someone who cannot open the report gets the same 404 as one that is not there.","parameters":[{"name":"reference","in":"query","required":true,"schema":{"type":"string","description":"The ID printed on the report, such as RPT-0012."}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedId"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/reports/mark-reimbursed":{"post":{"operationId":"Reports_bulkMarkReimbursed","tags":["reports"],"security":[{"session":[]},{"apiKey":["reports:write"]},{"oauth2":["reports:write"]}],"x-required-scope":"reports:write","x-requires-active-plan":true,"x-workspace-scoped":true,"x-full-access-only":true,"summary":"Mark many reports as reimbursed","description":"Answers 200 when all of them went through, and 207 when some did not. A report that is not approved yet, already paid or in a batch is skipped. One the caller cannot find or mark has failed.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReportsInput"},"example":{"reportIds":["string"]}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReimbursed"}}}},"207":{"description":"Some went through. The body says what became of each.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkReimbursed"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms":{"get":{"operationId":"Chat_rooms","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List rooms","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"sort","in":"query","required":false,"schema":{"default":"name","type":"string","enum":["name","members","activity"]}},{"name":"direction","in":"query","required":false,"schema":{"default":"asc","type":"string","enum":["asc","desc"]}},{"name":"open","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Chat_create","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a room","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRoomInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms/{id}":{"delete":{"operationId":"Chat_archive","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Archive a room","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Chat_room","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a room","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Chat_update","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a room","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRoomInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms/{id}/invites":{"post":{"operationId":"Chat_invite","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Make an invite link for a room","description":"Shown once. It opens the room to members of this workspace and to nobody else.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomInvite"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms/{id}/join":{"post":{"operationId":"Chat_join","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Join a room","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms/{id}/members":{"get":{"operationId":"Chat_members","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a room's members","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomMemberList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Chat_addMember","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add someone to a room","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoomMemberInput"},"example":{"userId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms/{id}/members/{userId}":{"delete":{"operationId":"Chat_removeMember","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Take someone out of a room","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms/{id}/messages":{"get":{"operationId":"Chat_messages","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a room's messages","description":"Pass `after` to poll for what is new.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"parentId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"after","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessagePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Chat_post","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Post a message","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostMessageInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostedMessage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms/{id}/messages/{messageId}":{"delete":{"operationId":"Chat_remove","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Delete a message","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"messageId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Chat_edit","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a message","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"messageId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditMessageInput"},"example":{"body":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms/{id}/messages/{messageId}/flag":{"post":{"operationId":"Chat_flag","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Flag a message","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"messageId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagMessageInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageFlagged"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms/{id}/messages/{messageId}/moderate":{"post":{"operationId":"Chat_moderate","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Decide on a flagged message","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"messageId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModerateMessageInput"},"example":{"action":"hide"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms/{id}/pin":{"post":{"operationId":"Chat_pin","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Pin or unpin a room","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PinRoomInput"},"example":{"pinned":false}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms/{id}/read":{"post":{"operationId":"Chat_read","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Mark a room as read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkReadInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms/{id}/unread":{"post":{"operationId":"Chat_unread","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Mark a room as unread","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkUnreadInput"},"example":{"messageId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms/direct":{"post":{"operationId":"Chat_direct","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Open a direct conversation","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenDirectInput"},"example":{"userId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms/group":{"post":{"operationId":"Chat_group","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Start a group conversation","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateGroupInput"},"example":{"memberIds":["string"]}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/rooms/join":{"post":{"operationId":"Chat_joinByCode","tags":["rooms"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Join a room with an invite code","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinRoomInput"},"example":{"code":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Room"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/sandbox":{"get":{"operationId":"Sandbox_get","tags":["sandbox"],"security":[{"session":[]}],"x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See this workspace's sandbox","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxState"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Sandbox_open","tags":["sandbox"],"security":[{"session":[]}],"x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Open the sandbox","description":"Creates it the first time and returns it after that, so it is safe to retry.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sandbox"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/saved-searches":{"get":{"operationId":"SavedSearches_list","tags":["saved-searches"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List saved searches","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedSearchList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"SavedSearches_create","tags":["saved-searches"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Save a search","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedSearchInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedSearch"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/saved-searches/{id}":{"delete":{"operationId":"SavedSearches_remove","tags":["saved-searches"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a saved search","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"SavedSearches_update","tags":["saved-searches"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a saved search","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSavedSearchInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedSearch"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/scheduled-reports":{"get":{"operationId":"ScheduledReports_list","tags":["scheduled-reports"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List scheduled reports","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledReportPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ScheduledReports_create","tags":["scheduled-reports"],"security":[{"session":[]}],"x-required-feature":"scheduled_reports","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Schedule a report","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledReportInput"},"example":{"name":"string","kind":"expenses","format":"CSV","cadence":"daily","recipients":["someone@example.com"]}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledReport"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/scheduled-reports/{id}":{"delete":{"operationId":"ScheduledReports_remove","tags":["scheduled-reports"],"security":[{"session":[]}],"x-required-feature":"scheduled_reports","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a scheduled report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"ScheduledReports_get","tags":["scheduled-reports"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a scheduled report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledReport"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"ScheduledReports_update","tags":["scheduled-reports"],"security":[{"session":[]}],"x-required-feature":"scheduled_reports","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a scheduled report","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateScheduledReportInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduledReport"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/scim-tokens":{"get":{"operationId":"ScimTokens_list","tags":["scim-tokens"],"security":[{"session":[]}],"x-required-permission":"security.manage","x-required-feature":"sso","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List SCIM tokens","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScimTokenList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ScimTokens_create","tags":["scim-tokens"],"security":[{"session":[]}],"x-required-permission":"security.manage","x-required-feature":"sso","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a SCIM token","description":"The token is in this response and nowhere else.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateScimTokenInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScimTokenCreated"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/scim-tokens/{id}":{"delete":{"operationId":"ScimTokens_revoke","tags":["scim-tokens"],"security":[{"session":[]}],"x-required-permission":"security.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Revoke a SCIM token","description":"Open on a lapsed plan: withdrawing access is never stopped.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/search":{"get":{"operationId":"Search_search","tags":["search"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Search everything in the workspace","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["expense","document","report","merchant","contact","message","task"]}},{"name":"limit","in":"query","required":false,"schema":{"default":5,"type":"integer","minimum":1,"maximum":50}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResults"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/search/accounting":{"get":{"operationId":"Search_accountingList","tags":["search"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"The accounting shortcuts your role gives you","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingShortcutList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/search/accounting/{shortcut}":{"get":{"operationId":"Search_accounting","tags":["search"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"One accounting shortcut, with a footer total over every row the filters select","parameters":[{"name":"shortcut","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string"}},{"name":"withdrawalType","in":"query","required":false,"schema":{"type":"string","enum":["MANUAL","PAYROLL","ACH","ACH_FILE","ACH_PROVIDER"]}},{"name":"groupBy","in":"query","required":false,"schema":{"type":"string","enum":["month","week","quarter","year"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountingShortcut"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/search/accounting/{shortcut}/export":{"get":{"operationId":"Search_accountingExport","tags":["search"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Download the rows behind an accounting shortcut as CSV","description":"The rows only: a grouped total or a footer is never in the file.","parameters":[{"name":"shortcut","in":"path","required":true,"schema":{"type":"string"}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"accountId","in":"query","required":false,"schema":{"type":"string"}},{"name":"withdrawalType","in":"query","required":false,"schema":{"type":"string","enum":["MANUAL","PAYROLL","ACH","ACH_FILE","ACH_PROVIDER"]}},{"name":"groupBy","in":"query","required":false,"schema":{"type":"string","enum":["month","week","quarter","year"]}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"text/csv":{"schema":{"type":"string","format":"binary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/search/accounting/bank-reconciliation/{reportId}/expenses":{"get":{"operationId":"Search_reimbursedExpenses","tags":["search"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"The expenses on one reimbursed report","parameters":[{"name":"reportId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BankReconciliationExpenses"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/search/shortcuts":{"get":{"operationId":"Search_shortcuts","tags":["search"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"What is waiting on you, across your workspaces","description":"Drafts, Needs approval and Ready to pay, each by the role you hold in each workspace.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchShortcuts"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/split":{"get":{"operationId":"Split_listSplits","tags":["split"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List splits","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSetPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Split_split","tags":["split"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Find the documents in a PDF","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Returns page ranges and extracts nothing. Up to 250 pages and 50 MB. split_by_blank_page cuts on blank pages instead of detected boundaries.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/split-and-classify":{"post":{"operationId":"Split_splitAndClassify","tags":["split-and-classify"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Find the documents in a PDF and say what each one is","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Each range has a type and a score, optionally from your own document_types.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/split-and-classify/async":{"post":{"operationId":"Split_splitAndClassifyAsync","tags":["split-and-classify"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Find and classify the documents in a PDF, in the background","description":"Answers at once. split.completed and split_and_classify.created deliver the same result, and split.failed and split_and_classify.failed say why not.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/split/{id}":{"get":{"operationId":"Split_getSplit","tags":["split"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a split","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/split/async":{"post":{"operationId":"Split_splitAsync","tags":["split"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Find the documents in a PDF, in the background","description":"Answers at once with the id. split.completed and split.created deliver the ranges, and split.failed says why not.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/sso":{"delete":{"operationId":"Sso_remove","tags":["sso"],"security":[{"session":[]}],"x-required-permission":"security.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Remove the single sign-on connection","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Sso_get","tags":["sso"],"security":[{"session":[]}],"x-required-permission":"security.manage","x-required-feature":"sso","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get the single sign-on connection","description":"Null when there is none.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoConnectionOrNone"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"Sso_save","tags":["sso"],"security":[{"session":[]}],"x-required-permission":"security.manage","x-required-feature":"sso","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Set up the single sign-on connection","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutSsoConnectionInput"},"example":{"protocol":"SAML","displayName":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoConnection"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/sso/enforcement":{"put":{"operationId":"Sso_enforcement","tags":["sso"],"security":[{"session":[]}],"x-required-permission":"security.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Turn single sign-on enforcement on or off","description":"Not behind the plan: a workspace that downgraded still has to be able to let its people back in.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoEnforcementInput"},"example":{"enforced":false}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoConnection"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/sso/metadata":{"get":{"operationId":"Sso_metadata","tags":["sso"],"security":[{"session":[]}],"x-required-permission":"security.manage","x-required-feature":"sso","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get the service provider metadata","description":"The XML to give an identity provider.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SsoMetadata"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/status":{"get":{"operationId":"Status_page","tags":["status"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Read the service status","description":"Needs no sign-in, and holds nothing about any customer.","parameters":[],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tags":{"get":{"operationId":"Tags_list","tags":["tags"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List tags","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Tags_create","tags":["tags"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a tag","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tags/{id}":{"delete":{"operationId":"Tags_remove","tags":["tags"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a tag","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Tags_get","tags":["tags"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a tag","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Tags_update","tags":["tags"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a tag","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTagInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tag"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tags/import":{"post":{"operationId":"Tags_import","tags":["tags"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import tags from CSV","description":"Send the CSV as text/plain, or as JSON with a `csv` field, with commas or tabs. Rows that match an existing tag update it. With mode=replace, what the file leaves out is deleted, or archived if something uses it. Columns: Name, Group, GL code, Color, Enabled, Depends on. A tag that depends on another goes on an expense only with that one.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportInput"},"example":{"csv":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tags/import-levels":{"post":{"operationId":"Tags_importLevels","tags":["tags"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Import multi-level tags","description":"Names a CSV or TSV file sent straight to storage, up to 50,000 rows, one column per level. It replaces the list.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagLevelImportInput"},"example":{"uploadId":"string","dependent":false}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogImportResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tags/levels":{"get":{"operationId":"Tags_levels","tags":["tags"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"What each Tag field offers on an expense","description":"One level per tag group. On a dependent list, each level narrows to what the levels above it allow.","parameters":[{"name":"tagIds","in":"query","required":false,"schema":{"type":"string","maxLength":4000}},{"name":"level","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TagLevels"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tasks":{"get":{"operationId":"Tasks_list","tags":["tasks"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List tasks","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["OPEN","DONE"]}},{"name":"mine","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskList"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Tasks_create","tags":["tasks"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a task","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskInput"},"example":{"roomId":"string","title":"string","assigneeId":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tasks/{id}":{"get":{"operationId":"Tasks_get","tags":["tasks"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Tasks_update","tags":["tasks"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateTaskInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tasks/{id}/complete":{"post":{"operationId":"Tasks_complete","tags":["tasks"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Complete a task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tasks/{id}/reopen":{"post":{"operationId":"Tasks_reopen","tags":["tasks"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Reopen a task","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tax/summary":{"get":{"operationId":"Tax_summary","tags":["tax"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Totals by tax line for a year","parameters":[{"name":"year","in":"query","required":false,"schema":{"type":"integer","minimum":2000,"maximum":2100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaxSummary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/time":{"post":{"operationId":"Time_create","tags":["time"],"security":[{"session":[]},{"apiKey":["expenses:write"]},{"oauth2":["expenses:write"]}],"x-required-scope":"expenses:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Record time","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTimeInput"},"example":{"date":"string","hours":0,"rateMinor":0,"description":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tls-certificates":{"get":{"operationId":"ClientCertificates_list","tags":["tls-certificates"],"security":[{"session":[]},{"apiKey":["workspace:read"]},{"oauth2":["workspace:read"]}],"x-required-scope":"workspace:read","x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List the client certificates this workspace trusts","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCertificatePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"ClientCertificates_create","tags":["tls-certificates"],"security":[{"session":[]},{"apiKey":["workspace:write"]},{"oauth2":["workspace:write"]}],"x-required-scope":"workspace:write","x-required-permission":"developer.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a client certificate","description":"PEM, and never a private key. Only its SHA-256 fingerprint decides anything, and adding the same one twice is one row. Mutual TLS ends at the edge, and has to be set up for this server before a workspace can require it.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateClientCertificateInput"},"example":{"name":"string","certificate":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCertificate"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tls-certificates/{id}":{"delete":{"operationId":"ClientCertificates_revoke","tags":["tls-certificates"],"security":[{"session":[]},{"apiKey":["workspace:write"]},{"oauth2":["workspace:write"]}],"x-required-scope":"workspace:write","x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Stop trusting a client certificate","description":"The last one cannot go while the workspace requires one.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/tls-certificates/enforcement":{"get":{"operationId":"ClientCertificates_enforcement","tags":["tls-certificates"],"security":[{"session":[]}],"x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"See whether keys must present a client certificate","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCertificateEnforcement"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"ClientCertificates_setEnforcement","tags":["tls-certificates"],"security":[{"session":[]}],"x-required-permission":"developer.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Require a client certificate, or stop requiring one","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetClientCertificateEnforcementInput"},"example":{"required":false}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientCertificateEnforcement"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/transactions":{"get":{"operationId":"Transactions_list","tags":["transactions"],"security":[{"session":[]},{"apiKey":["cards:read"]},{"oauth2":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List card transactions","parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["UNMATCHED","MATCHED","IGNORED","EXPENSED","PENDING"]}},{"name":"paymentAccountId","in":"query","required":false,"schema":{"type":"string"}},{"name":"paymentAccountIds","in":"query","required":false,"schema":{"type":"string","maxLength":20000}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"missingReceipt","in":"query","required":false,"schema":{"type":"string"}},{"name":"unreported","in":"query","required":false,"schema":{"type":"string"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/transactions/{id}":{"delete":{"operationId":"Transactions_remove","tags":["transactions"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a card transaction","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Transactions_get","tags":["transactions"],"security":[{"session":[]},{"apiKey":["cards:read"]},{"oauth2":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a card transaction","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/transactions/{id}/create-expense":{"post":{"operationId":"Transactions_createExpense","tags":["transactions"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Make an expense from a card transaction","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateExpenseFromTransactionInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExpenseDetail"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/transactions/{id}/ignore":{"post":{"operationId":"Transactions_ignore","tags":["transactions"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Ignore a card transaction","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/transactions/{id}/match":{"post":{"operationId":"Transactions_match","tags":["transactions"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Match a card transaction to an expense","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchTransactionInput"},"example":{"expenseId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/transactions/{id}/unmatch":{"post":{"operationId":"Transactions_unmatch","tags":["transactions"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Undo a match","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Transaction"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/transactions/bulk":{"post":{"operationId":"Transactions_bulk","tags":["transactions"],"security":[{"session":[]}],"x-required-feature":"card_feeds","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Act on many card transactions","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkTransactionInput"},"example":{"ids":["string"],"action":{"type":"match"}}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkTransactionResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/transactions/export":{"get":{"operationId":"Transactions_exportList","tags":["transactions"],"security":[{"session":[]},{"apiKey":["cards:read"]},{"oauth2":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Export card data","description":"By date range and card, with `unreported=true` for lines on no report. Leave it out for all of them. The file comes back as JSON, with its content as text.","parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["UNMATCHED","MATCHED","IGNORED","EXPENSED","PENDING"]}},{"name":"paymentAccountId","in":"query","required":false,"schema":{"type":"string"}},{"name":"paymentAccountIds","in":"query","required":false,"schema":{"type":"string","maxLength":20000}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"missingReceipt","in":"query","required":false,"schema":{"type":"string"}},{"name":"unreported","in":"query","required":false,"schema":{"type":"string"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DownloadableFile"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/transactions/reconciliation":{"get":{"operationId":"Transactions_reconciliation","tags":["transactions"],"security":[{"session":[]},{"apiKey":["cards:read"]},{"oauth2":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Reconcile card data for a date range","description":"Imported, approved and what is stuck, by where it is stuck.","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"paymentAccountId","in":"query","required":false,"schema":{"type":"string"}},{"name":"feed","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reconciliation"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/transactions/summary":{"get":{"operationId":"Transactions_summary","tags":["transactions"],"security":[{"session":[]},{"apiKey":["cards:read"]},{"oauth2":["cards:read"]}],"x-required-scope":"cards:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Total the card transactions that match a filter","parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["UNMATCHED","MATCHED","IGNORED","EXPENSED","PENDING"]}},{"name":"paymentAccountId","in":"query","required":false,"schema":{"type":"string"}},{"name":"paymentAccountIds","in":"query","required":false,"schema":{"type":"string","maxLength":20000}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"minMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"maxMinor","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},{"name":"missingReceipt","in":"query","required":false,"schema":{"type":"string"}},{"name":"unreported","in":"query","required":false,"schema":{"type":"string"}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","pattern":"^[A-Z]{3}$"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionSummary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/travel/trips":{"get":{"operationId":"Travel_list","tags":["travel"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List travel trips","description":"Trips filed from itineraries, newest first. Your own, or everyone's with `scope=all` when your role reads everyone's expenses. Trips driven are in the mileage log.","parameters":[{"name":"scope","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","all"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelTripPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/travel/trips/{id}":{"get":{"operationId":"Travel_get","tags":["travel"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a travel trip","description":"One trip, with its segments and the documents filed against it.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TravelTrip"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/uploads":{"post":{"operationId":"Uploads_create","tags":["uploads"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Sign an upload straight to storage","description":"The way to send a file: its bytes do not pass through this API. Say what it is for and how big it is, PUT the file to the URL in the answer, then name the uploadId on that feature's route in place of a multipart file. The file's own bytes decide what it is. Video goes to an attachment, up to 500 MiB, and is never read.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUploadInput"},"example":{"filename":"string","contentType":"string","sizeBytes":0,"purpose":"document"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadTicket"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/usage/documents":{"get":{"operationId":"UsageReports_documents","tags":["usage"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Count this month's documents, by type and by source","description":"For Home's usage meter. Reading never needs a plan.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUsage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/usage/processing":{"get":{"operationId":"UsageReports_processing","tags":["usage"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Report how long documents took to read","description":"For the processing report on Insights: the median, the spread, and the files behind them.","parameters":[{"name":"from","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProcessingReport"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/vehicles":{"get":{"operationId":"Vehicles_list","tags":["vehicles"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List vehicles","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"archived","in":"query","required":false,"schema":{"type":"string"}},{"name":"userId","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VehiclePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Vehicles_create","tags":["vehicles"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a vehicle","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VehicleInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vehicle"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/vehicles/{id}":{"delete":{"operationId":"Vehicles_remove","tags":["vehicles"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a vehicle","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Vehicles_get","tags":["vehicles"],"security":[{"session":[]},{"apiKey":["expenses:read"]},{"oauth2":["expenses:read"]}],"x-required-scope":"expenses:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a vehicle","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vehicle"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Vehicles_update","tags":["vehicles"],"security":[{"session":[]}],"x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a vehicle","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateVehicleInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Vehicle"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/w-8ben-e":{"post":{"operationId":"SpecialDocuments_w8BenE","tags":["w-8ben-e"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a Form W-8BEN-E","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"202":{"description":"Accepted. The document is still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/w2s":{"post":{"operationId":"SpecialDocuments_w2s","tags":["w2s"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a Form W-2","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"202":{"description":"Accepted. The document is still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/w2s-set":{"get":{"operationId":"DocumentSets_listW2Sets","tags":["w2s-set"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"List W-2 sets","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSetPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentSets_createW2Set","tags":["w2s-set"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Split a PDF of W-2s and read each one","description":"Multipart with a field named file, or JSON with uploadId, file_url or file_data. Up to 100 pages and 50 MB. Answers at once. w2_set.created says when every form is read, and w2_set.failed why not. Social security and employer numbers are masked in every view.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"external_id":{"type":"string","maxLength":200}}},"example":{}},"application/json":{"schema":{"type":"object","properties":{"uploadId":{"type":"string","description":"From POST /v1/uploads, once the file has been sent to the URL it answered with."},"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A public https address to fetch the file from. Redirects are not followed."},"file_data":{"type":"string","minLength":1,"description":"The file itself in base64, raw or as a data URI."},"file_name":{"type":"string","maxLength":255,"description":"What to call a file sent as file_url or file_data."},"external_id":{"type":"string","maxLength":200}},"description":"Name the file with one of uploadId, file_url or file_data.","allOf":[{"anyOf":[{"required":["uploadId"]},{"required":["file_url"]},{"required":["file_data"]}]}]},"example":{"uploadId":"string"}}}},"responses":{"202":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/w2s-set/{id}":{"get":{"operationId":"DocumentSets_getW2Set","tags":["w2s-set"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Get a W-2 set","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentSet"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/w9s":{"post":{"operationId":"SpecialDocuments_w9s","tags":["w9s"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Read a Form W-9","description":"POST /v1/documents/url with the type fixed: the same body, wait and answer. Bank and tax numbers are masked; POST /v1/documents/{id}/reveal opens them.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitDocumentInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"202":{"description":"Accepted. The document is still being read.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentUpload"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks":{"get":{"operationId":"Webhooks_list","tags":["webhooks"],"security":[{"session":[]},{"apiKey":["webhooks:manage"]},{"oauth2":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List webhook endpoints","description":"Pending and confirmed alike. Endpoints that belong to one API key are left out unless you ask: send apiKeyId for one key, or include=keys for all of them.","parameters":[{"name":"apiKeyId","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"include","in":"query","required":false,"schema":{"type":"string","enum":["keys"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"Webhooks_create","tags":["webhooks"],"security":[{"session":[]},{"apiKey":["webhooks:manage"]},{"oauth2":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Add a webhook endpoint","description":"Step one of the handshake. The URL must be public https, and not on papertotal.com. The endpoint starts PENDING, and PaperTotal sends it one signed subscription event holding a one-time token in data.token. Confirm it with POST /v1/webhooks/confirm within a day. Until then it receives nothing else, and after that it is deleted. An address on hooks.zapier.com is confirmed at once, because a catch hook cannot run a handshake. Send apiKeyId to make this one key's own endpoint: documents that key submits report here and not to the workspace's endpoints, it takes document events only, and a key has one. Changing the URL later goes through the handshake again. The signing secret is in this response and the rotate response, and nowhere else.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookInput"},"example":{"url":"string","events":["document.created"]}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/{id}":{"delete":{"operationId":"Webhooks_remove","tags":["webhooks"],"security":[{"session":[]},{"apiKey":["webhooks:manage"]},{"oauth2":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Delete a webhook endpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Webhooks_get","tags":["webhooks"],"security":[{"session":[]},{"apiKey":["webhooks:manage"]},{"oauth2":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a webhook endpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"Webhooks_update","tags":["webhooks"],"security":[{"session":[]},{"apiKey":["webhooks:manage"]},{"oauth2":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a webhook endpoint","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/{id}/deliveries":{"get":{"operationId":"Webhooks_deliveries","tags":["webhooks"],"security":[{"session":[]},{"apiKey":["webhooks:manage"]},{"oauth2":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List an endpoint's deliveries","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryPage"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/{id}/rotate-secret":{"post":{"operationId":"Webhooks_rotate","tags":["webhooks"],"security":[{"session":[]},{"apiKey":["webhooks:manage"]},{"oauth2":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Issue a new signing secret","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/{id}/test":{"post":{"operationId":"Webhooks_test","tags":["webhooks"],"security":[{"session":[]},{"apiKey":["webhooks:manage"]},{"oauth2":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Send a test event","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/confirm":{"post":{"operationId":"Webhooks_confirm","tags":["webhooks"],"security":[{"session":[]},{"apiKey":["webhooks:manage"]},{"oauth2":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Confirm a webhook endpoint","description":"Step three of the handshake. Send the token from the subscription event that went to the address. It works once, and expires after a day.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmWebhookInput"},"example":{"token":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/webhooks/deliveries/{id}/retry":{"post":{"operationId":"Webhooks_retry","tags":["webhooks"],"security":[{"session":[]},{"apiKey":["webhooks:manage"]},{"oauth2":["webhooks:manage"]}],"x-required-scope":"webhooks:manage","x-required-permission":"developer.manage","x-required-feature":"developer_api","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Send a delivery again","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"}],"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workflow-approvals":{"get":{"operationId":"WorkflowApprovalLinks_preview","tags":["workflow-approvals"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"See what an approval link is asking","description":"Needs no sign-in: the signed token in the link proves it. It decides nothing, because a mail scanner follows links.","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":2000}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowApprovalLink"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"WorkflowApprovalLinks_answer","tags":["workflow-approvals"],"security":[],"x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Answer with an approval link","description":"The first answer settles the step and the run goes on down that path. Any other answer changes nothing and says what happened.","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowApprovalTokenInput"},"example":{"token":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowApprovalAnswer"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workflows":{"get":{"operationId":"DocumentWorkflows_list","tags":["workflows"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List workflows","description":"The no-code workflows in this workspace. Not approval workflows, which live under /v1/approval-workflows.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentWorkflows_create","tags":["workflows"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Create a workflow","description":"A name, and a graph if you have one. A graph can be unfinished until it is turned on.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkflowInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workflows/{id}":{"delete":{"operationId":"DocumentWorkflows_remove","tags":["workflows"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Delete a workflow","description":"With its versions and runs. A file a run wrote stays in Exports until it expires.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"204":{"description":"Done, with no content.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"DocumentWorkflows_get","tags":["workflows"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a workflow","description":"The graph on the canvas, the version that runs, and what starts it: an Email collector's address, and when a schedule comes round next.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"DocumentWorkflows_update","tags":["workflows"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change a workflow","description":"Changes the canvas. What runs stays as it was until the workflow is turned on again.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkflowInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workflows/{id}/disable":{"post":{"operationId":"DocumentWorkflows_disable","tags":["workflows"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Turn a workflow off","description":"Nothing new starts. Runs already going finish.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workflows/{id}/enable":{"post":{"operationId":"DocumentWorkflows_enable","tags":["workflows"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Turn a workflow on","description":"Refused with the same findings as checking it. What is on the canvas becomes a version, and runs already going keep the one they started with.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workflows/{id}/runs":{"get":{"operationId":"DocumentWorkflows_listRuns","tags":["workflows"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-permission":"settings.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List a workflow's runs","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunPage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"DocumentWorkflows_start","tags":["workflows"],"security":[{"session":[]},{"apiKey":["documents:write"]},{"oauth2":["documents:write"]}],"x-required-scope":"documents:write","x-required-permission":"settings.manage","x-required-feature":"automation_rules","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Start a run","description":"Sends a file named by uploadId from POST /v1/uploads, or documents already in this workspace, to the workflow's API import. nodeId starts it at another input instead: a Document aggregator gathers what has come in, and Business insights runs its query. An upload, or an Idempotency-Key, makes a repeat answer with the first run.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartWorkflowRunInput"},"example":{}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRunSummary"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workflows/{id}/runs/{runId}":{"get":{"operationId":"DocumentWorkflows_getRun","tags":["workflows"],"security":[{"session":[]},{"apiKey":["documents:read"]},{"oauth2":["documents:read"]}],"x-required-scope":"documents:read","x-required-permission":"settings.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get a run and each of its steps","description":"Each step says what happened. A file comes with a signed link that lasts 15 minutes, and an approval says who was asked and who answered.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"runId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRun"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workflows/{id}/runs/{runId}/cancel":{"post":{"operationId":"DocumentWorkflows_cancelRun","tags":["workflows"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Stop a run","description":"A step already going finishes. Nothing after it starts.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"runId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRun"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workflows/{id}/runs/{runId}/steps/{stepId}/answer":{"post":{"operationId":"DocumentWorkflows_answerStep","tags":["workflows"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Answer an Email approval from the app","description":"The first answer settles the step. Repeating one changes nothing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"runId","in":"path","required":true,"schema":{"type":"string"}},{"name":"stepId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerWorkflowStepInput"},"example":{"decision":"approve"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowRun"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workflows/{id}/validate":{"post":{"operationId":"DocumentWorkflows_validate","tags":["workflows"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Check a workflow","description":"Says what would stop it being turned on: a loop, missing settings, a connection between steps that cannot work, and a service that is not connected. Saves nothing.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateWorkflowInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowValidation"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspace":{"delete":{"operationId":"WorkspaceClosure_close","tags":["workspace"],"security":[{"session":[]},{"apiKey":["workspace:delete"]},{"oauth2":["workspace:delete"]}],"x-required-scope":"workspace:delete","x-required-permission":"workspace.delete","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Close this workspace","description":"Needs the workspace:delete scope, which no preset holds, on a key an owner made. Send the name of the workspace to confirm. Its data is purged after the grace period.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloseWorkspaceInput"},"example":{"confirmName":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceClosed"}}}},"default":{"$ref":"#/components/responses/Error"}}},"get":{"operationId":"Workspaces_current","tags":["workspace"],"security":[{"session":[]},{"apiKey":["workspace:read"]},{"oauth2":["workspace:read"]}],"x-required-scope":"workspace:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get this workspace, its plan and its usage","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"default":{"$ref":"#/components/responses/Error"}}},"patch":{"operationId":"WorkspaceSettings_update","tags":["workspace"],"security":[{"session":[]},{"apiKey":["workspace:write"]},{"oauth2":["workspace:write"]}],"x-required-scope":"workspace:write","x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Change this workspace","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWorkspaceInput"},"example":{}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspace/copy-settings":{"post":{"operationId":"WorkspaceSettings_copySettings","tags":["workspace"],"security":[{"session":[]}],"x-required-permission":"settings.manage","x-requires-active-plan":true,"x-workspace-scoped":true,"summary":"Copy this workspace's settings to another","description":"Takes two workspaces, so a key, which reaches one, cannot call it. The source stays as it was.","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CopySettingsInput"},"example":{"sourceId":"string","sections":["categories"],"confirmName":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CopySettingsResult"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspace/counts":{"get":{"operationId":"Workspaces_counts","tags":["workspace"],"security":[{"session":[]},{"apiKey":["workspace:read"]},{"oauth2":["workspace:read"]}],"x-required-scope":"workspace:read","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Count what is waiting on the caller","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCounts"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspace/offboarding":{"get":{"operationId":"WorkspaceSettings_offboarding","tags":["workspace"],"security":[{"session":[]}],"x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"List what someone leaving still holds","description":"Someone leaving can read their own. Anyone else needs members.manage.","parameters":[{"name":"userId","in":"query","required":false,"schema":{"type":"string"}},{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OffboardingList"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspace/security":{"get":{"operationId":"WorkspaceSecurity_get","tags":["workspace"],"security":[{"session":[]}],"x-required-permission":"security.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Get the workspace sign-in rules","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceSecurity"}}}},"default":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"WorkspaceSecurity_put","tags":["workspace"],"security":[{"session":[]}],"x-required-permission":"security.manage","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Change the workspace sign-in rules","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"},{"$ref":"#/components/parameters/X-Act-As"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceSecurityInput"},"example":{"requireMfa":false}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceSecurity"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspace/transfer":{"post":{"operationId":"WorkspaceClosure_transfer","tags":["workspace"],"security":[{"session":[]}],"x-required-permission":"workspace.delete","x-requires-active-plan":false,"x-workspace-scoped":true,"summary":"Hand this workspace to another owner","parameters":[{"$ref":"#/components/parameters/X-Workspace-Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferWorkspaceInput"},"example":{"memberId":"string"}}}},"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceTransferred"}}}},"default":{"$ref":"#/components/responses/Error"}}}},"/v1/workspaces":{"get":{"operationId":"WorkspacesCreate_list","tags":["workspaces"],"security":[{"session":[]},{"apiKey":["workspace:read"]},{"oauth2":["workspace:read"]}],"x-required-scope":"workspace:read","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"List the workspaces this credential reaches","description":"A key or an app is bound to one workspace, so it lists that one. A person lists all of theirs.","parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspacePage"}}}},"default":{"$ref":"#/components/responses/Error"}}},"post":{"operationId":"WorkspacesCreate_create","tags":["workspaces"],"security":[{"session":[]},{"apiKey":["workspace:write"]},{"oauth2":["workspace:write"]}],"x-required-scope":"workspace:write","x-requires-active-plan":false,"x-workspace-scoped":false,"summary":"Create a workspace","description":"The caller's person owns it. It starts with what their one trial has left, or with no plan: reading and exporting work, and capture waits on a plan. A plan cannot be bought by an API call, so naming one returns the billing link where a person pays for it. A key stays bound to its own workspace, so the new one needs a key of its own.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replaying a key returns the first record instead of creating, and charging for, a second. While the first request is still running, a retry answers 409 IDEMPOTENCY_IN_PROGRESS with a Retry-After, and is not charged. The same key on a different request answers 409 IDEMPOTENCY_CONFLICT.","schema":{"type":"string","minLength":8,"maxLength":100}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceInput"},"example":{"name":"string"}}}},"responses":{"201":{"description":"Success.","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceCreated"}}}},"default":{"$ref":"#/components/responses/Error"}}}}},"webhooks":{"document.created":{"post":{"summary":"The document.created event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"document.created"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"document.processed":{"post":{"summary":"The document.processed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"document.processed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"document.failed":{"post":{"summary":"The document.failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"document.failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"document.enriched":{"post":{"summary":"The document.enriched event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"document.enriched"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"document.enrichment_failed":{"post":{"summary":"The document.enrichment_failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"document.enrichment_failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"document_set.completed":{"post":{"summary":"The document_set.completed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"document_set.completed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"document_set.failed":{"post":{"summary":"The document_set.failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"document_set.failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"split.completed":{"post":{"summary":"The split.completed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"split.completed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"split.created":{"post":{"summary":"The split.created event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"split.created"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"split.failed":{"post":{"summary":"The split.failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"split.failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"split_and_classify.created":{"post":{"summary":"The split_and_classify.created event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"split_and_classify.created"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"split_and_classify.failed":{"post":{"summary":"The split_and_classify.failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"split_and_classify.failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"w2_set.created":{"post":{"summary":"The w2_set.created event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"w2_set.created"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"w2_set.failed":{"post":{"summary":"The w2_set.failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"w2_set.failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"bank_statement_set.created":{"post":{"summary":"The bank_statement_set.created event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"bank_statement_set.created"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"bank_statement_set.failed":{"post":{"summary":"The bank_statement_set.failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"bank_statement_set.failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"expense.created":{"post":{"summary":"The expense.created event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"expense.created"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"expense.updated":{"post":{"summary":"The expense.updated event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"expense.updated"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"expense.deleted":{"post":{"summary":"The expense.deleted event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"expense.deleted"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"report.submitted":{"post":{"summary":"The report.submitted event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"report.submitted"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"report.approved":{"post":{"summary":"The report.approved event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"report.approved"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"report.rejected":{"post":{"summary":"The report.rejected event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"report.rejected"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"report.reimbursed":{"post":{"summary":"The report.reimbursed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"report.reimbursed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"integration.posted":{"post":{"summary":"The integration.posted event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"integration.posted"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"integration.failed":{"post":{"summary":"The integration.failed event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"integration.failed"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}},"subscription":{"post":{"summary":"The subscription event","description":"Answer with any 2xx within 10 seconds. A 410 turns the endpoint off. Anything else is retried with exponential backoff, 8 attempts over about 24 hours. Redirects are not followed. Delivery is at least once, so use the event id to ignore repeats.","parameters":[{"name":"X-PaperTotal-Signature","in":"header","required":true,"description":"HMAC-SHA256 of \"<t>.<body>\" with the endpoint's signing secret, in hex, sent as t=<unix seconds>,v1=<hex>. Compute it over the raw bytes, and refuse a timestamp more than five minutes old.","schema":{"type":"string"}},{"name":"X-PaperTotal-Event","in":"header","required":true,"schema":{"type":"string","const":"subscription"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEventPayload"}}}},"responses":{"200":{"description":"Received."}}}}},"components":{"securitySchemes":{"session":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"A Firebase ID token, for a person signed in to the web app or a phone app."},"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"ptk_live_...","description":"Scopes: documents:read, documents:write, documents:reveal, expenses:read, expenses:write, reports:read, reports:write, contacts:read, webhooks:manage, members:read, members:write, workspace:read, workspace:write, workspace:delete, rules:read, rules:write, cards:read, mailin:read, mailin:write, billing:read, billing:write, integrations:read."},"oauth2":{"type":"oauth2","description":"Authorization code with PKCE (S256). A token starts pta_, reaches one workspace and one resource, and acts as the person who granted it, narrowed by scope.","flows":{"authorizationCode":{"authorizationUrl":"https://api.papertotal.com/oauth/authorize","tokenUrl":"https://api.papertotal.com/oauth/token","refreshUrl":"https://api.papertotal.com/oauth/token","scopes":{"documents:read":"Read documents","documents:write":"Add and change documents","documents:reveal":"Reveal sensitive numbers","expenses:read":"Read expenses","expenses:write":"Add and change expenses","reports:read":"Read reports","reports:write":"Change reports","contacts:read":"Read contacts","webhooks:manage":"Manage webhooks","members:read":"Read members","members:write":"Manage members","workspace:read":"Read workspace settings","workspace:write":"Change workspace settings","workspace:delete":"Close the workspace","rules:read":"Read rules","rules:write":"Change rules","cards:read":"Read cards","mailin:read":"Read mail-in","mailin:write":"Request mail-in","billing:read":"Read billing","billing:write":"Change billing","integrations:read":"Read integrations","mcp:tools":"Read through an AI assistant","mcp:write":"Add documents without asking each time"}}}}},"parameters":{"X-Workspace-Id":{"name":"X-Workspace-Id","in":"header","required":false,"description":"The workspace this request is for, from the person's `workspaces` on GET /v1/me. Left out, it is their default workspace. A workspace they are not in answers 404.","schema":{"type":"string"}},"X-Act-As":{"name":"X-Act-As","in":"header","required":false,"description":"The user id of someone who named the caller their delegate, to act for them. Checked on every request, so a delegation that ended stops at once, with 403 and `details.reason`.","schema":{"type":"string"}}},"headers":{"X-RateLimit-Limit":{"description":"Requests allowed in the window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Seconds until the window resets.","schema":{"type":"integer"}}},"responses":{"Error":{"description":"Something went wrong. `code` is stable and `message` is written for a person.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"TravelTripListQuery":{"type":"object","properties":{"scope":{"default":"mine","type":"string","enum":["mine","all"]},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}},"CreateClientCertificateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"certificate":{"type":"string","minLength":1,"maxLength":20000}},"required":["name","certificate"]},"ReleaseNotificationQuery":{"type":"object","properties":{"product":{"$ref":"#/components/schemas/ReleaseProduct"},"environment":{"$ref":"#/components/schemas/ReleaseEnvironment"}}},"CreateAttachmentInput":{"type":"object","properties":{"uploadId":{"type":"string","minLength":1,"maxLength":64}},"required":["uploadId"]},"CreateUploadInput":{"type":"object","properties":{"filename":{"type":"string"},"contentType":{"type":"string","maxLength":200},"sizeBytes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"purpose":{"type":"string","enum":["document","document_set","expense_receipt","odometer_photo","policy_document","statement","attachment","catalog_import","iif_lists","people_list","profile_photo"]},"clientId":{"type":"string","minLength":8,"maxLength":255}},"required":["filename","contentType","sizeBytes","purpose"]},"ExportRecordInput":{"type":"object","properties":{"documentIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1}},"target":{"type":"string","minLength":1,"maxLength":60},"externalId":{"type":"string","minLength":1,"maxLength":200}},"required":["documentIds","target"]},"ExportRecordQuery":{"type":"object","properties":{"documentId":{"type":"string"},"target":{"type":"string","maxLength":60},"externalId":{"type":"string","maxLength":200},"via":{"type":"string","enum":["EXPORT","SYNC","API"]}}},"DocumentReadQuery":{"type":"object","properties":{"bounding_boxes":{"type":"boolean"},"confidence_details":{"type":"boolean"},"detailed":{"type":"boolean"},"with_scores":{"type":"boolean"}}},"DocumentTagInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}},"required":["name"]},"DocumentTagsInput":{"type":"object","properties":{"tags":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}}},"required":["tags"]},"ExpenseLineInput":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":500},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"categoryId":{"type":["string","null"]}},"required":["description","amountMinor"]},"ExpenseTaxLineInput":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"ratePct":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"baseMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000}},"required":["amountMinor"]},"UpdateExpenseLineInput":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":500},"sku":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"categoryId":{"type":["string","null"]}}},"UpdateExpenseTaxLineInput":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"code":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}]},"ratePct":{"anyOf":[{"type":"number","minimum":0,"maximum":100},{"type":"null"}]},"baseMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000}}},"CategoryImportQuery":{"type":"object","properties":{"mode":{"type":"string","enum":["merge","replace"]}}},"CloseWorkspaceInput":{"type":"object","properties":{"confirmName":{"type":"string","minLength":1,"maxLength":200}},"required":["confirmName"]},"ProvisionInput":{"type":"object","properties":{"employees":{"maxItems":2000,"type":"array","items":{"type":"object","properties":{"employeeEmail":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"managerEmail":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"employeeID":{"type":"string","minLength":1,"maxLength":60},"policyID":{"type":"string","minLength":1},"approvalLimit":{"type":"integer","minimum":0,"maximum":9007199254740991},"overLimitApprover":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"workerStatus":{"type":"string","minLength":1,"maxLength":60},"isTerminated":{"type":"boolean"},"domainGroupID":{"type":"string","minLength":1},"approvesTo":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"type":"string","minLength":1,"maxLength":30},"additionalPolicyIDs":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"defaultTags":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"firstName":{"type":"string","maxLength":60},"lastName":{"type":"string","maxLength":60},"customField1":{"type":"string","maxLength":200},"customField2":{"type":"string","maxLength":200},"payrollCode":{"type":"string","maxLength":120},"title":{"type":"string","maxLength":120},"department":{"type":"string","maxLength":120},"costCenter":{"type":"string","maxLength":120},"officeLocation":{"type":"string","maxLength":120},"legalEntity":{"type":"string","maxLength":120},"workerType":{"type":"string","maxLength":120}},"required":["employeeEmail"]}},"url":{"type":"string","format":"uri"},"dryRun":{"type":"boolean"},"shouldFixApprovalChains":{"type":"boolean"},"removeMissing":{"type":"boolean"}}},"AutomationPreviewInput":{"type":"object","properties":{"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["merchantName","description","amountMinor","currency","cardLast4","paymentType","categoryId","merchantType","date","notes","invoiceNumber","ocrText","subtotalMinor","taxMinor","tipMinor","confidence","billable","reimbursable","documentType","source","tags","flags","lineItems.description","lineItems.sku","lineItems.amountMinor","lineItems.quantity","ai"]},"op":{"type":"string","enum":["equals","contains","contains_case","starts_with","gte","lte","not_equals","not_contains","gt","lt","is_empty","is_not_empty","matches_regex","not_matches_regex","between","within_days_before_today","within_days_after_date","within_days_before_date","ask"]},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"days":{"type":"integer","minimum":0,"maximum":3650}},"required":["date","days"],"additionalProperties":false}]},"fallback":{"type":"string","enum":["no_match","match"]}},"required":["field","op"]}}},"required":["conditions"]},"AutomationRuleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"default":true,"type":"boolean"},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["merchantName","description","amountMinor","currency","cardLast4","paymentType","categoryId","merchantType","date","notes","invoiceNumber","ocrText","subtotalMinor","taxMinor","tipMinor","confidence","billable","reimbursable","documentType","source","tags","flags","lineItems.description","lineItems.sku","lineItems.amountMinor","lineItems.quantity","ai"]},"op":{"type":"string","enum":["equals","contains","contains_case","starts_with","gte","lte","not_equals","not_contains","gt","lt","is_empty","is_not_empty","matches_regex","not_matches_regex","between","within_days_before_today","within_days_after_date","within_days_before_date","ask"]},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"days":{"type":"integer","minimum":0,"maximum":3650}},"required":["date","days"],"additionalProperties":false}]},"fallback":{"type":"string","enum":["no_match","match"]}},"required":["field","op"]}},"actions":{"type":"object","properties":{"categoryId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"tagIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"$ref":"#/components/schemas/PaymentType"},"description":{"type":"string","minLength":1,"maxLength":1000},"merchantName":{"type":"string","minLength":1,"maxLength":255},"taxBasisPoints":{"type":"integer","minimum":0,"maximum":10000},"vendorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"postToBooks":{"type":"boolean","const":true},"clear":{"maxItems":3,"type":"array","items":{"type":"string","enum":["categoryId","tagIds","taxMinor"]}},"reportId":{"type":"string","minLength":1},"autoApprove":{"type":"boolean","const":true},"reject":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"flagForReview":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"setStatus":{"type":"string","enum":["NEEDS_REVIEW","READY"]},"group":{"type":"object","properties":{"report":{"type":"string","minLength":1,"maxLength":200}},"required":["report"]},"setCustomFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"number"},{"type":"boolean"}]}},"extract":{"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"regex"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"pattern":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","field","pattern"]},{"type":"object","properties":{"kind":{"type":"string","const":"key_value"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","field","label"]}]}},"llmExtract":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"prompt":{"type":"string","minLength":1,"maxLength":2000},"examples":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"input":{"type":"string","minLength":1,"maxLength":500},"output":{"type":"string","minLength":1,"maxLength":200}},"required":["input","output"]}},"fallback":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"none"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"flag_for_review"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"set_value"},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["action","value"]}]}},"required":["field","prompt","fallback"]}}}}},"required":["name","conditions","actions"]},"BulkMemberInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1}},"role":{"$ref":"#/components/schemas/MemberRole"},"status":{"$ref":"#/components/schemas/MemberStatus"},"managerId":{"type":["string","null"]}},"required":["ids"]},"CreateInvitationInput":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","minLength":1,"maxLength":120},"role":{"$ref":"#/components/schemas/MemberRole"},"message":{"type":"string","maxLength":500}},"required":["email"]},"ChangeMailInAddressInput":{"type":"object","properties":{"shippingAddress":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"type":"string","minLength":1,"maxLength":120},"region":{"type":"string","minLength":1,"maxLength":120},"postalCode":{"type":"string","minLength":1,"maxLength":20},"country":{"default":"US","type":"string","pattern":"^[A-Z]{2}$"}},"required":["name","line1","city","region","postalCode"]}},"required":["shippingAddress"],"additionalProperties":false},"MailInSettingsInput":{"type":"object","properties":{"address":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"type":"string","minLength":1,"maxLength":120},"region":{"type":"string","minLength":1,"maxLength":120},"postalCode":{"type":"string","minLength":1,"maxLength":20},"country":{"default":"US","type":"string","pattern":"^[A-Z]{2}$"}},"required":["name","line1","city","region","postalCode"]},{"type":"null"}]}},"required":["address"],"additionalProperties":false},"CreateMailInInput":{"type":"object","properties":{"envelopes":{"default":1,"type":"integer","minimum":0,"maximum":10},"expectedDocuments":{"type":"integer","minimum":1,"maximum":5000},"afterScan":{"$ref":"#/components/schemas/MailInDisposal"},"shippingAddress":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"type":"string","minLength":1,"maxLength":120},"region":{"type":"string","minLength":1,"maxLength":120},"postalCode":{"type":"string","minLength":1,"maxLength":20},"country":{"default":"US","type":"string","pattern":"^[A-Z]{2}$"}},"required":["name","line1","city","region","postalCode"]},"folderId":{"type":["string","null"]},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["expectedDocuments"]},"CreateWorkspaceInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"baseCurrency":{"type":"string","pattern":"^[A-Z]{3}$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":60},"copyFromId":{"type":"string","minLength":1},"copySections":{"type":"array","items":{"type":"string","enum":["categories","tags","customFields","reportFields","distanceRates","perDiem","workflows","rules","merchantRules","policies","members","accountingConnection","overview"]}},"plan":{"$ref":"#/components/schemas/PlanKey"},"interval":{"$ref":"#/components/schemas/BillingInterval"}},"required":["name"]},"InvitationListQuery":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/InvitationStatus"}}},"MemberListQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200},"status":{"$ref":"#/components/schemas/MemberStatus"},"role":{"$ref":"#/components/schemas/MemberRole"}}},"PaymentAccountListQuery":{"type":"object","properties":{"archived":{"type":"string"}}},"PersonalRuleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"default":true,"type":"boolean"},"merchantContains":{"type":"string","minLength":1,"maxLength":200},"actions":{"type":"object","properties":{"categoryId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"tagIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"$ref":"#/components/schemas/PaymentType"},"description":{"type":"string","minLength":1,"maxLength":1000},"merchantName":{"type":"string","minLength":1,"maxLength":255},"taxBasisPoints":{"type":"integer","minimum":0,"maximum":10000},"vendorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"postToBooks":{"type":"boolean","const":true},"clear":{"maxItems":3,"type":"array","items":{"type":"string","enum":["categoryId","tagIds","taxMinor"]}},"reportId":{"type":"string","minLength":1},"autoApprove":{"type":"boolean","const":true},"reject":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"flagForReview":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"setStatus":{"type":"string","enum":["NEEDS_REVIEW","READY"]},"group":{"type":"object","properties":{"report":{"type":"string","minLength":1,"maxLength":200}},"required":["report"]},"setCustomFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"number"},{"type":"boolean"}]}},"extract":{"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"regex"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"pattern":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","field","pattern"]},{"type":"object","properties":{"kind":{"type":"string","const":"key_value"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","field","label"]}]}},"llmExtract":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"prompt":{"type":"string","minLength":1,"maxLength":2000},"examples":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"input":{"type":"string","minLength":1,"maxLength":500},"output":{"type":"string","minLength":1,"maxLength":200}},"required":["input","output"]}},"fallback":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"none"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"flag_for_review"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"set_value"},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["action","value"]}]}},"required":["field","prompt","fallback"]}}}},"ownerId":{"type":"string","minLength":1}},"required":["name","merchantContains","actions"]},"PersonalRuleQuery":{"type":"object","properties":{"ownerId":{"type":"string","minLength":1}}},"ReconciliationQuery":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"paymentAccountId":{"type":"string"},"feed":{"type":"string","maxLength":64},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}},"required":["from","to"]},"ReorderAutomationRulesInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","minLength":1}}},"required":["ids"]},"RulesDocument":{"type":"object","properties":{"format":{"type":"string","const":"papertotal.rules"},"version":{"type":"number","const":1},"exportedAt":{"type":"string","maxLength":40},"rules":{"maxItems":1000,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"default":true,"type":"boolean"},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["merchantName","description","amountMinor","currency","cardLast4","paymentType","categoryId","merchantType","date","notes","invoiceNumber","ocrText","subtotalMinor","taxMinor","tipMinor","confidence","billable","reimbursable","documentType","source","tags","flags","lineItems.description","lineItems.sku","lineItems.amountMinor","lineItems.quantity","ai"]},"op":{"type":"string","enum":["equals","contains","contains_case","starts_with","gte","lte","not_equals","not_contains","gt","lt","is_empty","is_not_empty","matches_regex","not_matches_regex","between","within_days_before_today","within_days_after_date","within_days_before_date","ask"]},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"days":{"type":"integer","minimum":0,"maximum":3650}},"required":["date","days"],"additionalProperties":false}]},"fallback":{"type":"string","enum":["no_match","match"]}},"required":["field","op"]}},"actions":{"type":"object","properties":{"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"$ref":"#/components/schemas/PaymentType"},"description":{"type":"string","minLength":1,"maxLength":1000},"merchantName":{"type":"string","minLength":1,"maxLength":255},"taxBasisPoints":{"type":"integer","minimum":0,"maximum":10000},"postToBooks":{"type":"boolean","const":true},"clear":{"maxItems":3,"type":"array","items":{"type":"string","enum":["categoryId","tagIds","taxMinor"]}},"autoApprove":{"type":"boolean","const":true},"reject":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"flagForReview":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"setStatus":{"type":"string","enum":["NEEDS_REVIEW","READY"]},"group":{"type":"object","properties":{"report":{"type":"string","minLength":1,"maxLength":200}},"required":["report"]},"setCustomFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"number"},{"type":"boolean"}]}},"extract":{"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"regex"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"pattern":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","field","pattern"]},{"type":"object","properties":{"kind":{"type":"string","const":"key_value"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","field","label"]}]}},"llmExtract":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"prompt":{"type":"string","minLength":1,"maxLength":2000},"examples":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"input":{"type":"string","minLength":1,"maxLength":500},"output":{"type":"string","minLength":1,"maxLength":200}},"required":["input","output"]}},"fallback":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"none"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"flag_for_review"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"set_value"},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["action","value"]}]}},"required":["field","prompt","fallback"]}},"category":{"type":"string","minLength":1,"maxLength":200},"project":{"type":"string","minLength":1,"maxLength":200},"client":{"type":"string","minLength":1,"maxLength":200},"vendor":{"type":"string","minLength":1,"maxLength":200},"tags":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"group":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["name"],"additionalProperties":false}}},"additionalProperties":false}},"required":["name","conditions","actions"],"additionalProperties":false}}},"required":["format","version","rules"],"additionalProperties":false},"ReportFieldInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"type":{"$ref":"#/components/schemas/ReportFieldType"},"options":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"formula":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"required":{"type":"boolean"},"enabled":{"type":"boolean"},"position":{"type":"integer","minimum":0,"maximum":10000}},"required":["name","type"]},"SyncRecordQuery":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/SyncState"}}},"TransactionListQuery":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/TransactionState"},"paymentAccountId":{"type":"string"},"paymentAccountIds":{"type":"string","maxLength":20000},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"q":{"type":"string","maxLength":200},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"missingReceipt":{"type":"string"},"unreported":{"type":"string"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}}},"UpdateAutomationRuleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"enabled":{"type":"boolean"},"conditions":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["merchantName","description","amountMinor","currency","cardLast4","paymentType","categoryId","merchantType","date","notes","invoiceNumber","ocrText","subtotalMinor","taxMinor","tipMinor","confidence","billable","reimbursable","documentType","source","tags","flags","lineItems.description","lineItems.sku","lineItems.amountMinor","lineItems.quantity","ai"]},"op":{"type":"string","enum":["equals","contains","contains_case","starts_with","gte","lte","not_equals","not_contains","gt","lt","is_empty","is_not_empty","matches_regex","not_matches_regex","between","within_days_before_today","within_days_after_date","within_days_before_date","ask"]},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"days":{"type":"integer","minimum":0,"maximum":3650}},"required":["date","days"],"additionalProperties":false}]},"fallback":{"type":"string","enum":["no_match","match"]}},"required":["field","op"]}},"actions":{"type":"object","properties":{"categoryId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"tagIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"$ref":"#/components/schemas/PaymentType"},"description":{"type":"string","minLength":1,"maxLength":1000},"merchantName":{"type":"string","minLength":1,"maxLength":255},"taxBasisPoints":{"type":"integer","minimum":0,"maximum":10000},"vendorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"postToBooks":{"type":"boolean","const":true},"clear":{"maxItems":3,"type":"array","items":{"type":"string","enum":["categoryId","tagIds","taxMinor"]}},"reportId":{"type":"string","minLength":1},"autoApprove":{"type":"boolean","const":true},"reject":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"flagForReview":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"setStatus":{"type":"string","enum":["NEEDS_REVIEW","READY"]},"group":{"type":"object","properties":{"report":{"type":"string","minLength":1,"maxLength":200}},"required":["report"]},"setCustomFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"number"},{"type":"boolean"}]}},"extract":{"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"regex"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"pattern":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","field","pattern"]},{"type":"object","properties":{"kind":{"type":"string","const":"key_value"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","field","label"]}]}},"llmExtract":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"prompt":{"type":"string","minLength":1,"maxLength":2000},"examples":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"input":{"type":"string","minLength":1,"maxLength":500},"output":{"type":"string","minLength":1,"maxLength":200}},"required":["input","output"]}},"fallback":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"none"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"flag_for_review"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"set_value"},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["action","value"]}]}},"required":["field","prompt","fallback"]}}}}}},"UpdateMemberInput":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/MemberRole"},"status":{"$ref":"#/components/schemas/MemberStatus"},"developer":{"type":"boolean"},"managerId":{"type":["string","null"]},"title":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"department":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"employeeId":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"approvalLimitMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000000000},{"type":"null"}]},"overLimitApproverId":{"type":["string","null"]},"forwardToId":{"type":["string","null"]},"workerStatus":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"defaultTags":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"customField1":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"customField2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"payrollCode":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"legalEntity":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"tier":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"officeLocation":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"costCenter":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"accountingCode":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"workerType":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}}},"UpdateReportFieldInput":{"type":"object","properties":{"options":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"formula":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"null"}]},"required":{"type":"boolean"},"enabled":{"type":"boolean"},"position":{"type":"integer","minimum":0,"maximum":10000},"disabledOptions":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}}}},"UpdateWorkspaceInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"baseCurrency":{"type":"string","pattern":"^[A-Z]{3}$"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"timezone":{"type":"string","minLength":1,"maxLength":60},"fiscalYearStartMonth":{"type":"integer","minimum":1,"maximum":12},"distanceUnit":{"type":"string","enum":["mi","km"]},"retentionDays":{"anyOf":[{"type":"integer","minimum":60,"maximum":3650},{"type":"null"}]},"callLogRetentionDays":{"anyOf":[{"type":"integer","minimum":30,"maximum":3650},{"type":"null"}]},"readingModel":{"$ref":"#/components/schemas/ReadingModel"},"locale":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"showDefaultCategories":{"type":"boolean"},"shredDocuments":{"type":"boolean"},"vatBasisPoints":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"reimbursableTracking":{"type":"boolean"},"calculateMissingTax":{"type":"boolean"},"dateFormat":{"$ref":"#/components/schemas/DateFormat"}}},"AgentJoinInput":{"type":"object","properties":{"workspaceId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"ReportLookupQuery":{"type":"object","properties":{"reference":{"type":"string","description":"The ID printed on the report, such as RPT-0012."}},"required":["reference"]},"OutsideDecisionInput":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["reason"]},"MoveExpensesInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}},"to":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"report"},"reportId":{"type":"string","minLength":1}},"required":["type","reportId"]},{"type":"object","properties":{"type":{"type":"string","const":"new"},"title":{"type":"string","minLength":1,"maxLength":200}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"auto"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"none"}},"required":["type"]}]}},"required":["ids","to"]},"DuplicateExpensesInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"}}},"required":["ids"]},"BulkHoldInput":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"hold"},"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}},"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["action","ids","reason"]},{"type":"object","properties":{"action":{"type":"string","const":"release"},"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}}},"required":["action","ids"]}]},"ProfilePhotoInput":{"type":"object","properties":{"uploadId":{"type":"string","minLength":1}},"required":["uploadId"]},"UnlockPrivateDetailsInput":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["code"]},"SavePrivateDetailsInput":{"type":"object","properties":{"unlockToken":{"type":"string","minLength":1,"maxLength":2000},"details":{"$ref":"#/components/schemas/PrivateDetails"}},"required":["unlockToken","details"]},"ConnectHrInput":{"type":"object","properties":{"system":{"type":"string","minLength":1,"maxLength":40},"credentials":{"default":{},"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":60},"additionalProperties":{"type":"string","maxLength":2000}},"approvalMode":{"$ref":"#/components/schemas/HrApprovalMode"}},"required":["system"]},"UpdateHrSettingsInput":{"type":"object","properties":{"approvalMode":{"$ref":"#/components/schemas/HrApprovalMode"}},"required":["approvalMode"],"additionalProperties":false},"ImportPeopleFileInput":{"type":"object","properties":{"uploadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"complete":{"type":"boolean"}},"required":["uploadId"]},"PeopleWebhookInput":{"type":"object","properties":{"people":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"object","properties":{"externalId":{"type":"string","minLength":1,"maxLength":200},"email":{"anyOf":[{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"status":{"default":"ACTIVE","type":"string","enum":["ACTIVE","INACTIVE","TERMINATED"]},"managerExternalId":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"managerEmail":{"anyOf":[{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"department":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"costCenter":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"location":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"legalEntity":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"workerType":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"employeeNumber":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"payrollCode":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}]}},"required":["externalId"]}},"complete":{"type":"boolean"}},"required":["people"],"additionalProperties":false},"InvoiceSettingsInput":{"type":"object","properties":{"enabled":{"type":"boolean"},"supplierName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"supplierAddress":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"taxNumbers":{"type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"type":"string","maxLength":60}},"terms":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}}},"InvoiceListQuery":{"type":"object","properties":{"status":{"type":"string","enum":["DRAFT","SENT","VIEWED","PARTIALLY_PAID","PAID","VOID","OVERDUE"]},"q":{"type":"string","maxLength":200}}},"CreateInvoiceInput":{"type":"object","properties":{"recipientName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"recipientEmail":{"anyOf":[{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"recipientPhone":{"anyOf":[{"type":"string","pattern":"^[+\\d][\\d\\s().-]{5,24}$"},{"type":"null"}]},"shareWith":{"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"issueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"terms":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"supplierName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"supplierAddress":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"supplierTaxNumber":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"lines":{"default":[],"maxItems":500,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":500},"quantity":{"default":1,"type":"number","exclusiveMinimum":0,"maximum":1000000},"unitMinor":{"type":"integer","minimum":-1000000000000,"maximum":1000000000000},"taxKind":{"anyOf":[{"$ref":"#/components/schemas/InvoiceTaxKind"},{"type":"null"}]},"taxBasisPoints":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"expenseId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["description","unitMinor"]}},"expenseIds":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","minLength":1}}}},"BulkInvoiceInput":{"type":"object","properties":{"csv":{"type":"string","minLength":1,"maxLength":5000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"send":{"default":false,"type":"boolean"}},"required":["csv"]},"UpdateInvoiceInput":{"type":"object","properties":{"recipientName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"recipientEmail":{"anyOf":[{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]},"recipientPhone":{"anyOf":[{"type":"string","pattern":"^[+\\d][\\d\\s().-]{5,24}$"},{"type":"null"}]},"shareWith":{"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"issueDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"terms":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"supplierName":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"supplierAddress":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"supplierTaxNumber":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"lines":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":500},"quantity":{"default":1,"type":"number","exclusiveMinimum":0,"maximum":1000000},"unitMinor":{"type":"integer","minimum":-1000000000000,"maximum":1000000000000},"taxKind":{"anyOf":[{"$ref":"#/components/schemas/InvoiceTaxKind"},{"type":"null"}]},"taxBasisPoints":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"expenseId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["description","unitMinor"]}}}},"RecordInvoicePaymentInput":{"type":"object","properties":{"kind":{"default":"PAYMENT","type":"string","enum":["PAYMENT","REFUND"]},"amountMinor":{"type":"integer","minimum":1,"maximum":1000000000000},"paidOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"reference":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]}},"required":["amountMinor","paidOn"]},"InvoiceMessageInput":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":2000}},"required":["body"]},"InvoiceToPayQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200}}},"MoneyFlowQuery":{"type":"object","properties":{"months":{"default":6,"type":"integer","minimum":1,"maximum":12}}},"ExpenseGroupQuery":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/ExpenseStatus"},{"type":"array","items":{"$ref":"#/components/schemas/ExpenseStatus"}}]},"kind":{"$ref":"#/components/schemas/ExpenseKind"},"paymentType":{"$ref":"#/components/schemas/PaymentType"},"ownerId":{"type":"string"},"scope":{"default":"all","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"$ref":"#/components/schemas/ExpenseDateField"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200},"groupBy":{"$ref":"#/components/schemas/ExpenseGroupBy"}},"required":["groupBy"]},"BulkEditOptionsInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}}},"required":["ids"]},"BulkEditInput":{"type":"object","properties":{"ids":{"minItems":2,"maxItems":500,"type":"array","items":{"type":"string"}},"fields":{"type":"object","properties":{"merchantName":{"type":["string","null"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"categoryId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string"}},"tagLevels":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"level":{"type":"string","minLength":1,"maxLength":255},"tagId":{"type":["string","null"]}},"required":["level","tagId"]}},"attendees":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[+\\d][\\d\\s().-]*$"}},"required":["name"]}}}}},"required":["ids","fields"]},"MergeExpensesInput":{"type":"object","properties":{"keepId":{"type":"string","minLength":1},"otherId":{"type":"string","minLength":1},"take":{"default":{},"type":"object","properties":{"merchantName":{"type":"string","enum":["keep","other"]},"date":{"type":"string","enum":["keep","other"]},"amountMinor":{"type":"string","enum":["keep","other"]},"description":{"type":"string","enum":["keep","other"]},"categoryId":{"type":"string","enum":["keep","other"]},"tagIds":{"type":"string","enum":["keep","other"]},"receipt":{"type":"string","enum":["keep","other"]}}}},"required":["keepId","otherId"]},"EditSplitInput":{"type":"object","properties":{"rows":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"categoryId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string"}},"reimbursable":{"type":"boolean"},"id":{"type":"string"}},"required":["amountMinor"]}}},"required":["rows"]},"ReimbursementDetailsInput":{"type":"object","properties":{"reportIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1}},"fullNumbers":{"type":"boolean"}},"required":["reportIds"]},"PolicyRuleListQuery":{"type":"object","properties":{"tab":{"type":"string","enum":["general","cards","fields","flags"]}}},"TagLevelImportInput":{"type":"object","properties":{"uploadId":{"type":"string","minLength":1,"maxLength":64},"dependent":{"type":"boolean"}},"required":["uploadId","dependent"]},"TagLevelsQuery":{"type":"object","properties":{"tagIds":{"type":"string","maxLength":4000},"level":{"type":"string","maxLength":80},"q":{"type":"string","maxLength":200}}},"AbaExportInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","minLength":1}},"processOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"regenerate":{"default":false,"type":"boolean"}},"required":["ids","processOn"]},"AbaOriginatorInput":{"type":"object","properties":{"bankCode":{"type":"string","pattern":"^[A-Z]{3}$"},"userName":{"type":"string","minLength":1,"maxLength":26},"userId":{"type":"string","pattern":"^\\d{6}$"},"bsb":{"type":"string"},"accountNumber":{"type":"string","pattern":"^[0-9A-Za-z-]{1,9}$"},"description":{"default":"REIMBURSE","type":"string","minLength":1,"maxLength":12}},"required":["bankCode","userName","userId","bsb","accountNumber"]},"AcceptInvitationInput":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":200}},"required":["token"]},"AchOriginatorInput":{"type":"object","properties":{"bankRoutingNumber":{"type":"string"},"bankName":{"type":"string","minLength":1,"maxLength":23},"companyName":{"type":"string","minLength":1,"maxLength":16},"companyId":{"type":"string","pattern":"^[0-9A-Za-z]{1,10}$"},"originId":{"anyOf":[{"type":"string","pattern":"^[0-9A-Za-z]{1,10}$"},{"type":"null"}]},"originName":{"anyOf":[{"type":"string","minLength":1,"maxLength":23},{"type":"null"}]},"secCode":{"default":"PPD","type":"string","enum":["PPD","CCD"]},"entryDescription":{"default":"REIMBURSE","type":"string","minLength":1,"maxLength":10}},"required":["bankRoutingNumber","bankName","companyName","companyId"]},"AddDomainAdminInput":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","minLength":5,"maxLength":40}}},"AddSenderInput":{"type":"object","properties":{"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["email"]},"AgentScheduleInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"instruction":{"type":"string","minLength":1,"maxLength":6000},"cadence":{"type":"string","pattern":"^(daily|weekly:[0-6]|monthly:(?:[1-9]|1\\d|2[0-8]|last))$"},"enabled":{"default":true,"type":"boolean"}},"required":["title","instruction","cadence"]},"ApiCallListQuery":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":200},"status":{"type":"string","pattern":"^[1-5](?:[0-9]{2}|xx)$"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}},"ApprovalQueueQuery":{"type":"object","properties":{"scope":{"default":"mine","type":"string","enum":["mine","all"]}}},"ApprovalWorkflowInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"isDefault":{"type":"boolean"},"steps":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"level":{"type":"integer","minimum":1,"maximum":20},"kind":{"$ref":"#/components/schemas/ApprovalStepKind"},"userId":{"type":"string","minLength":1},"inviteEmail":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"role":{"$ref":"#/components/schemas/MemberRole"},"overMinor":{"type":"integer","minimum":0,"maximum":10000000000000}},"required":["level","kind"]}},"autoApproveUnderMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000000000},{"type":"null"}]},"memberIds":{"maxItems":1000,"type":"array","items":{"type":"string","minLength":1}}},"required":["name","steps"]},"AskAssistantInput":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":4000},"context":{"type":"object","properties":{"reportId":{"type":"string","maxLength":64},"expenseId":{"type":"string","maxLength":64}}}},"required":["message"]},"AskInsightsInput":{"type":"object","properties":{"question":{"type":"string","minLength":1,"maxLength":500},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["question"]},"AssignCardInput":{"type":"object","properties":{"userId":{"type":"string","minLength":1},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","pattern":"^[+\\d][\\d\\s().-]{5,24}$"},"transactionStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}}},"AuditListQuery":{"type":"object","properties":{"action":{"type":"string","maxLength":100},"entityType":{"type":"string","maxLength":60},"entityId":{"type":"string","maxLength":100},"actorId":{"type":"string","maxLength":100},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}},"BudgetInput":{"type":"object","properties":{"scope":{"$ref":"#/components/schemas/BudgetScope"},"targetId":{"type":"string","minLength":1},"period":{"$ref":"#/components/schemas/BudgetPeriod"},"totalMinor":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},{"type":"null"}]},"perMemberMinor":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},{"type":"null"}]},"thresholds":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"integer","minimum":1,"maximum":1000}}},"required":["scope","targetId"]},"BulkDeleteAgentsInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","maxLength":64}}},"required":["ids"]},"BulkPaymentAccountInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1}},"action":{"type":"string","const":"unassign"}},"required":["ids","action"]},"BulkTransactionInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1}},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"match"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"unmatch"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"set_category"},"categoryId":{"type":"string","minLength":1}},"required":["type","categoryId"]},{"type":"object","properties":{"type":{"type":"string","const":"create_expense"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"exclude"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"include"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"delete"}},"required":["type"]}]}},"required":["ids","action"]},"CalcGstInput":{"type":"object","properties":{"expenseIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["expenseIds"]},"CardLayoutInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"mapping":{"type":"object","properties":{"date":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"amount":{"type":"string","minLength":1},"debit":{"type":"string","minLength":1},"credit":{"type":"string","minLength":1},"merchant":{"type":"string","minLength":1},"externalId":{"type":"string","minLength":1},"currency":{"type":"string","minLength":1},"fixedCurrency":{"type":"string","pattern":"^[A-Z]{3}$"},"card":{"type":"string","minLength":1},"employeeId":{"type":"string","minLength":1},"category":{"type":"string","minLength":1},"tag":{"type":"string","minLength":1},"mcc":{"type":"string","minLength":1},"dateOrder":{"default":"MDY","type":"string","enum":["YMD","MDY","DMY"]},"spendIs":{"default":"POSITIVE","type":"string","enum":["POSITIVE","NEGATIVE"]},"decimalSeparator":{"default":".","type":"string","enum":[".",","]}},"required":["date","description"]}},"required":["name","mapping"]},"CategoryAccessInput":{"type":"object","properties":{"userIds":{"maxItems":1000,"type":"array","items":{"type":"string","minLength":1}}},"required":["userIds"]},"ChatPreferenceInput":{"type":"object","properties":{"priorityMode":{"$ref":"#/components/schemas/ChatPriorityMode"}},"required":["priorityMode"]},"CheckoutRequest":{"type":"object","properties":{"plan":{"$ref":"#/components/schemas/PlanKey"},"interval":{"$ref":"#/components/schemas/BillingInterval"},"seats":{"type":"integer","exclusiveMinimum":0,"maximum":100000}},"required":["plan","interval"]},"ChooseOrganisationInput":{"type":"object","properties":{"organisationId":{"type":"string","minLength":1,"maxLength":200}},"required":["organisationId"]},"ClaimDomainInput":{"type":"object","properties":{"name":{"type":"string","minLength":3,"maxLength":253,"pattern":"^(?!-)[a-z0-9-]+(\\.[a-z0-9-]+)+$"},"workspaceId":{"type":"string","minLength":1}},"required":["name","workspaceId"]},"ConfirmMergeInput":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"code":{"type":"string","pattern":"^\\d{6}$"},"otherToken":{"type":"string","minLength":1,"maxLength":8000}},"required":["email","code","otherToken"]},"CopySettingsInput":{"type":"object","properties":{"sourceId":{"type":"string","minLength":1},"sections":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/CopySection"}},"confirmName":{"type":"string","minLength":1}},"required":["sourceId","sections","confirmName"]},"CreateAgentInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","maxLength":500},"instructions":{"default":"","type":"string","maxLength":6000},"templateKey":{"type":"string","maxLength":40},"grants":{"default":[],"maxItems":60,"type":"array","items":{"type":"object","properties":{"tool":{"type":"string","minLength":1,"maxLength":64},"limits":{"type":"object","properties":{"maxTotalMinor":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}}},"required":["tool"]}}},"required":["name"]},"CreateApiKeyInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"scopes":{"default":[],"type":"array","items":{"$ref":"#/components/schemas/ApiKeyScopeName"}},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"kind":{"default":"PERSONAL","type":"string","enum":["PERSONAL","WORKSPACE"]},"fullAccess":{"default":false,"type":"boolean"},"managerIds":{"default":[],"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"signing":{"default":"OFF","type":"string","enum":["OFF","OPTIONAL","REQUIRED"]}},"required":["name"]},"CreateContactInput":{"$ref":"#/components/schemas/UpdateContactInput"},"CreateDelegationInput":{"type":"object","properties":{"delegateId":{"type":"string","minLength":1},"delegateEmail":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"delegatorId":{"type":"string","minLength":1},"access":{"$ref":"#/components/schemas/DelegationAccess"},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}}},"CreateDocumentShareInput":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"maxLength":64},"direction":{"default":"share","type":"string","enum":["share","request","both"]}},"required":["userId"]},"CreateExpenseFromTransactionInput":{"type":"object","properties":{"categoryId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"tagIds":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1}},"reimbursable":{"type":"boolean"},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}}},"CreateGroupInput":{"type":"object","properties":{"name":{"type":"string","maxLength":60},"memberIds":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}},"required":["memberIds"]},"CreateJoinLinkInput":{"type":"object","properties":{"role":{"$ref":"#/components/schemas/MemberRole"},"requiresApproval":{"type":"boolean"},"expiresInDays":{"type":"integer","minimum":1,"maximum":365}}},"CreateOAuthClientInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"uri":{"type":"string","maxLength":2000,"format":"uri"},"logoUri":{"type":"string","maxLength":2000,"format":"uri"},"redirectUris":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"scopes":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/OAuthScopeName"}},"public":{"default":false,"type":"boolean"}},"required":["name","redirectUris","scopes"]},"CreateReimbursementInput":{"type":"object","properties":{"reportIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1}},"method":{"default":"MANUAL","$ref":"#/components/schemas/ReimbursementMethod"},"separate":{"type":"boolean"},"reference":{"type":"string","minLength":1,"maxLength":120},"note":{"type":"string","maxLength":1000}},"required":["reportIds"]},"CreateRoomInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","maxLength":500},"visibility":{"default":"WORKSPACE","$ref":"#/components/schemas/RoomVisibility"},"posting":{"default":"ALL_MEMBERS","$ref":"#/components/schemas/RoomPosting"},"memberIds":{"default":[],"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}},"required":["name"]},"CreateScimTokenInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"expiresInDays":{"type":"integer","minimum":1,"maximum":730}},"required":["name"]},"CreateTaskInput":{"type":"object","properties":{"roomId":{"type":"string","minLength":1,"maxLength":64},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":10000},"assigneeId":{"type":"string","minLength":1,"maxLength":64}},"required":["roomId","title","assigneeId"]},"CustomFieldInput":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","SELECT","BOOLEAN"]},"options":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"required":{"type":"boolean"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","label","type"]},"DecideAccessInput":{"type":"object","properties":{"approve":{"type":"boolean"}},"required":["approve"]},"DeleteAccountInput":{"type":"object","properties":{"confirmEmail":{"type":"string","minLength":1,"maxLength":320}},"required":["confirmEmail"]},"DescribeRuleInput":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":6000}},"required":["prompt"]},"DiscoverSignInInput":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["email"]},"DomainGroupInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"isDefault":{"type":"boolean"},"strictRules":{"type":"boolean"},"restrictLogin":{"type":"boolean"},"restrictWorkspaces":{"type":"boolean"},"preferredWorkspaceId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"cardWorkspaceId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["name"]},"DomainInviteInput":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","maxLength":120},"role":{"$ref":"#/components/schemas/MemberRole"}},"required":["email"]},"DraftAgentInput":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":4000},"instructions":{"type":"string","maxLength":6000}},"required":["message"]},"EditMessageInput":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":10000}},"required":["body"]},"EmailSignInInput":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["email"]},"ExpenseVendorInput":{"type":"object","properties":{"vendorId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]}},"required":["vendorId"]},"ExportTemplateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"columns":{"minItems":1,"maxItems":60,"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":80},"formula":{"type":"string","maxLength":500}},"required":["key"]}},"shared":{"type":"boolean"}},"required":["name","columns"]},"FailReimbursementInput":{"type":"object","properties":{"reason":{"type":"string","maxLength":500},"code":{"$ref":"#/components/schemas/ReimbursementFailureCode"},"removeBankAccount":{"default":false,"type":"boolean"}}},"FlagMessageInput":{"type":"object","properties":{"reason":{"type":"string","maxLength":500}}},"ForwardingAliasInput":{"type":"object","properties":{"alias":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{2,38}[a-z0-9]$"}},"required":["alias"]},"FraudSettingsInput":{"type":"object","properties":{"enabled":{"type":"boolean"},"yellowAt":{"type":"number","minimum":0.05,"maximum":0.95},"redAt":{"type":"number","minimum":0.05,"maximum":0.99},"profiles":{"type":"object","properties":{"RECEIPTS":{"type":"object","properties":{"signals":{"type":"object","propertyNames":{"$ref":"#/components/schemas/FraudSignal"},"additionalProperties":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number","minimum":0,"maximum":1}},"required":["enabled","threshold"]}},"monitoredFields":{"maxItems":15,"type":"array","items":{"$ref":"#/components/schemas/FraudMonitoredField"}}},"required":["signals","monitoredFields"]},"CHECKS":{"type":"object","properties":{"signals":{"type":"object","propertyNames":{"$ref":"#/components/schemas/FraudSignal"},"additionalProperties":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number","minimum":0,"maximum":1}},"required":["enabled","threshold"]}},"monitoredFields":{"maxItems":15,"type":"array","items":{"$ref":"#/components/schemas/FraudMonitoredField"}}},"required":["signals","monitoredFields"]},"BANK_STATEMENTS":{"type":"object","properties":{"signals":{"type":"object","propertyNames":{"$ref":"#/components/schemas/FraudSignal"},"additionalProperties":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number","minimum":0,"maximum":1}},"required":["enabled","threshold"]}},"monitoredFields":{"maxItems":15,"type":"array","items":{"$ref":"#/components/schemas/FraudMonitoredField"}}},"required":["signals","monitoredFields"]}},"required":["RECEIPTS","CHECKS","BANK_STATEMENTS"]},"suspiciousWords":{"maxItems":200,"type":"array","items":{"type":"string","minLength":2,"maxLength":60}},"pdfCreatorKeywords":{"maxItems":100,"type":"array","items":{"type":"string","minLength":2,"maxLength":60}},"velocity":{"type":"object","properties":{"high":{"type":"object","properties":{"lastMinutes":{"type":"integer","minimum":1,"maximum":100000},"lastDay":{"type":"integer","minimum":1,"maximum":100000},"lastWeek":{"type":"integer","minimum":1,"maximum":100000},"last2Weeks":{"type":"integer","minimum":1,"maximum":100000},"lastMonth":{"type":"integer","minimum":1,"maximum":100000}},"required":["lastMinutes","lastDay","lastWeek","last2Weeks","lastMonth"]},"critical":{"type":"object","properties":{"lastMinutes":{"type":"integer","minimum":1,"maximum":100000},"lastDay":{"type":"integer","minimum":1,"maximum":100000},"lastWeek":{"type":"integer","minimum":1,"maximum":100000},"last2Weeks":{"type":"integer","minimum":1,"maximum":100000},"lastMonth":{"type":"integer","minimum":1,"maximum":100000}},"required":["lastMinutes","lastDay","lastWeek","last2Weeks","lastMonth"]}},"required":["high","critical"]},"duplicateSpike":{"type":"object","properties":{"enabled":{"type":"boolean"},"percent":{"type":"integer","minimum":1,"maximum":100},"minVolume":{"type":"integer","minimum":50,"maximum":100000}},"required":["enabled","percent","minVolume"]}},"required":["enabled","yellowAt","redAt","profiles","suspiciousWords","pdfCreatorKeywords","velocity","duplicateSpike"]},"InboxQuery":{"type":"object","properties":{"tab":{"default":"all","type":"string","enum":["all","unread","todos"]}}},"JoinEmailInput":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["email"]},"JoinRoomInput":{"type":"object","properties":{"code":{"type":"string","minLength":8,"maxLength":100}},"required":["code"]},"JoinVerifyInput":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["email","code"]},"MarkReadInput":{"type":"object","properties":{"messageId":{"type":"string","minLength":1,"maxLength":64}}},"MarkReimbursementPaidInput":{"type":"object","properties":{"reference":{"type":"string","minLength":1,"maxLength":120},"paidOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":"string","enum":["MANUAL","PAYROLL","ACH_FILE"]},"acceptOverpayment":{"default":false,"type":"boolean"}}},"MarkUnreadInput":{"type":"object","properties":{"messageId":{"type":"string","minLength":1,"maxLength":64}},"required":["messageId"]},"MatchTransactionInput":{"type":"object","properties":{"expenseId":{"type":"string","minLength":1}},"required":["expenseId"]},"MerchantCopiesInput":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]},"MessageListQuery":{"type":"object","properties":{"parentId":{"type":"string","minLength":1,"maxLength":64},"after":{"type":"string","minLength":1,"maxLength":64}}},"MileageRateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"unit":{"type":"string","enum":["mi","km"]},"rateMinor":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"effectiveTo":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"isDefault":{"type":"boolean"},"archived":{"type":"boolean"},"taxBasisPoints":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"taxReclaimableMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["name","rateMinor"]},"MileageYearQuery":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"tripId":{"type":"string"}},"required":["date"]},"ModerateMessageInput":{"type":"object","properties":{"action":{"type":"string","enum":["hide","delete","dismiss"]}},"required":["action"]},"NachaExportInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","minLength":1}},"effectiveDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"regenerate":{"default":false,"type":"boolean"}},"required":["ids","effectiveDate"]},"NetSuiteCredentialsInput":{"type":"object","properties":{"accountId":{"type":"string","minLength":1,"maxLength":40},"clientId":{"type":"string","pattern":"^[A-Za-z0-9_-]{16,128}$"},"folderId":{"type":"string","pattern":"^\\d{1,20}$"},"subsidiaryId":{"anyOf":[{"type":"string","pattern":"^\\d{1,20}$"},{"type":"null"}]}},"required":["accountId","clientId","folderId"]},"OAuthConsentInput":{"type":"object","properties":{"request":{"type":"string","minLength":1,"maxLength":8000},"workspaceId":{"type":"string","minLength":1},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/OAuthScopeName"}}},"required":["request","workspaceId","scopes"]},"OAuthConsentQuery":{"type":"object","properties":{"request":{"type":"string","minLength":1,"maxLength":8000}},"required":["request"]},"OAuthDenyInput":{"type":"object","properties":{"request":{"type":"string","minLength":1,"maxLength":8000}},"required":["request"]},"OnboardingInput":{"type":"object","properties":{"intent":{"$ref":"#/components/schemas/OnboardingIntent"},"workspaceName":{"type":"string","minLength":1,"maxLength":120},"timezone":{"type":"string","minLength":1,"maxLength":60}},"required":["intent"]},"OpenDirectInput":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"maxLength":64}},"required":["userId"]},"PaymentAccountInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"default":"CREDIT_CARD","$ref":"#/components/schemas/PaymentAccountKind"},"brand":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"last4":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"isCompany":{"default":false,"type":"boolean"},"ownerId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["name"]},"PayrollExportQuery":{"type":"object","properties":{"ids":{"type":"string"}}},"PeopleQuery":{"type":"object","properties":{"q":{"default":"","type":"string","maxLength":100}}},"PerDiemRateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"country":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"region":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"amountMinor":{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"archived":{"type":"boolean"}},"required":["name","amountMinor"]},"PinRoomInput":{"type":"object","properties":{"pinned":{"type":"boolean"}},"required":["pinned"]},"PlaidExchangeInput":{"type":"object","properties":{"publicToken":{"type":"string","minLength":1,"maxLength":500},"institutionName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"isCompany":{"default":false,"type":"boolean"}},"required":["publicToken"]},"PolicyRuleInput":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/PolicyRuleType"},"severity":{"default":"WARN","$ref":"#/components/schemas/PolicySeverity"},"enabled":{"default":true,"type":"boolean"},"categoryId":{"type":["string","null"]},"amountMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000000000},{"type":"null"}]},"days":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":3650},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":["type"]},"PostMessageInput":{"type":"object","properties":{"body":{"default":"","type":"string","maxLength":10000},"mentions":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"parentId":{"type":"string","minLength":1,"maxLength":64},"attachmentIds":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}}}},"ProcessingReportQuery":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"]},"PutSsoConnectionInput":{"oneOf":[{"type":"object","properties":{"protocol":{"type":"string","const":"SAML"},"displayName":{"type":"string","minLength":1,"maxLength":80},"metadataXml":{"type":"string","minLength":1,"maxLength":500000},"idpEntityId":{"type":"string","minLength":1,"maxLength":1024},"ssoUrl":{"type":"string","format":"uri"},"certificate":{"type":"string","minLength":1,"maxLength":20000}},"required":["protocol","displayName"]},{"type":"object","properties":{"protocol":{"type":"string","const":"OIDC"},"displayName":{"type":"string","minLength":1,"maxLength":80},"clientId":{"type":"string","minLength":1,"maxLength":512},"issuer":{"type":"string","format":"uri"},"clientSecret":{"type":"string","minLength":1,"maxLength":1024}},"required":["protocol","displayName","clientId","issuer"]}]},"RecodeExpenseInput":{"type":"object","properties":{"categoryId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}}},"RedeemEmailSignInInput":{"anyOf":[{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["email","code"]},{"type":"object","properties":{"token":{"type":"string","minLength":16,"maxLength":200}},"required":["token"]}]},"RedeemJoinLinkInput":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":200}},"required":["token"]},"RegisterDeviceInput":{"type":"object","properties":{"token":{"type":"string","minLength":8,"maxLength":4096},"platform":{"type":"string","enum":["IOS","ANDROID","WEB"]},"appVersion":{"type":"string","maxLength":40},"locale":{"type":"string","maxLength":20}},"required":["token","platform"]},"ReimbursementListQuery":{"type":"object","properties":{"status":{"$ref":"#/components/schemas/ReimbursementStatus"},"payeeId":{"type":"string"}}},"ReimbursementSettingsInput":{"type":"object","properties":{"payerId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"autoBatchUnderMinor":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},{"type":"null"}]},"requireCardMatch":{"type":["boolean","null"]},"detailsExport":{"type":["boolean","null"]}}},"ReleaseSubscriptionInput":{"type":"object","properties":{"products":{"maxItems":7,"type":"array","items":{"$ref":"#/components/schemas/ReleaseProduct"}}},"required":["products"]},"RemoveDeviceInput":{"type":"object","properties":{"token":{"type":"string","minLength":8,"maxLength":4096}},"required":["token"]},"RenamePlaidItemInput":{"type":"object","properties":{"institutionName":{"type":"string","minLength":1,"maxLength":120}},"required":["institutionName"]},"ReportSettingsInput":{"type":"object","properties":{"autoReport":{"type":"object","properties":{"schedule":{"$ref":"#/components/schemas/AutoReportSchedule"},"weekday":{"type":"integer","minimum":0,"maximum":6},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"secondDayOfMonth":{"type":"integer","minimum":1,"maximum":31},"titleTemplate":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["schedule"]},"randomAuditPercent":{"type":"integer","minimum":0,"maximum":100},"strictPolicies":{"type":"boolean"},"rulesEnabled":{"type":"boolean"},"prohibitedItems":{"maxItems":7,"type":"array","items":{"$ref":"#/components/schemas/ProhibitedItem"}},"titleFormula":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"titleLocked":{"type":"boolean"},"policyText":{"anyOf":[{"type":"string","maxLength":20000},{"type":"null"}]},"cashExpenses":{"anyOf":[{"type":"string","enum":["REIMBURSABLE","NON_REIMBURSABLE","ALWAYS_REIMBURSABLE","ALWAYS_NON_REIMBURSABLE"]},{"type":"null"}]},"externalCheckUrl":{"anyOf":[{"type":"string","maxLength":500,"format":"uri"},{"type":"null"}]},"showGlCodes":{"type":"boolean"},"preventSelfApproval":{"type":"boolean"},"preventPayingNonReimbursable":{"type":"boolean"},"autoApproveCompliant":{"type":"boolean"},"publicReceipts":{"type":"boolean"},"fringeBenefits":{"type":"boolean"},"attendeeTracking":{"type":"boolean"},"billableExpenses":{"type":"string","enum":["DISABLED","DEFAULT_BILLABLE","DEFAULT_NON_BILLABLE"]}}},"ReportSuspiciousInput":{"type":"object","properties":{"note":{"type":"string","maxLength":500}}},"RequestDomainAccessInput":{"type":"object","properties":{"name":{"type":"string","minLength":3,"maxLength":253,"pattern":"^(?!-)[a-z0-9-]+(\\.[a-z0-9-]+)+$"}},"required":["name"]},"RestrictSenderInput":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"maxLength":64},"reason":{"type":"string","maxLength":500},"days":{"type":"integer","minimum":1,"maximum":365}},"required":["userId"]},"ReviewQuery":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"resend":{"type":"string","enum":["true","false"]}}},"MoveReportInput":{"type":"object","properties":{"workspaceId":{"type":"string","minLength":1,"maxLength":64}},"required":["workspaceId"]},"RoomListQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":100},"sort":{"default":"name","type":"string","enum":["name","members","activity"]},"direction":{"default":"asc","type":"string","enum":["asc","desc"]},"open":{"type":"string","enum":["true","false"]}}},"RoomMemberInput":{"type":"object","properties":{"userId":{"type":"string","minLength":1,"maxLength":64}},"required":["userId"]},"BulkPerDiemInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1}},"action":{"type":"string","enum":["update","delete"]},"update":{"type":"object","properties":{"amountMinor":{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"archived":{"type":"boolean"}}}},"required":["ids","action"]},"CommuteInput":{"type":"object","properties":{"home":{"type":"string","minLength":1,"maxLength":200},"distance":{"type":"number","minimum":0,"maximum":100000}},"required":["home","distance"]},"MoveExpenseInput":{"type":"object","properties":{"workspaceId":{"type":"string","minLength":1}},"required":["workspaceId"]},"PerDiemTemplateInput":{"type":"object","properties":{"template":{"type":"string","enum":["DE","SE","FI","ZA"]}},"required":["template"]},"UpdateDistanceSettingsInput":{"type":"object","properties":{"requireGpsOrMap":{"type":"boolean"},"excludeCommutes":{"$ref":"#/components/schemas/CommuteExclusion"},"trackTax":{"type":"boolean"},"governmentRate":{"type":"object","properties":{"enabled":{"type":"boolean"},"country":{"anyOf":[{"type":"string","pattern":"^[A-Z]{2}$"},{"type":"null"}]}},"required":["enabled"]}}},"UpdatePerDiemSettingsInput":{"type":"object","properties":{"defaultCategoryId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["defaultCategoryId"]},"RouteEstimateInput":{"type":"object","properties":{"addresses":{"minItems":2,"maxItems":12,"type":"array","items":{"type":"string","minLength":3,"maxLength":200}},"rateId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["addresses"]},"S3AccessInput":{"type":"object","properties":{"accessKeyId":{"type":"string","minLength":16,"maxLength":128},"secretAccessKey":{"type":"string","minLength":16,"maxLength":128},"region":{"type":"string","pattern":"^[a-z]{2}(?:-[a-z]+)+-\\d$"}},"required":["accessKeyId","secretAccessKey","region"]},"SaveAgentRuleInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"role":{"$ref":"#/components/schemas/AgentRuleRole"},"prompt":{"type":"string","minLength":1,"maxLength":6000},"plan":{"type":"object","properties":{"events":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"string","enum":["report.submitted","report.auto_approved","report.step_approved","report.approved","report.rejected","report.retracted","report.reopened","report.sent_back","report.expense_rejected","report.findings_accepted","expense.held","expense.released","report.created","report.updated","report.deleted","report.reassigned","report.closed","report.held_moved","report.expenses_added","report.expense_removed","report.approver_replaced","report.audit_sampled","report.moved","reimbursement.created","reimbursement.paid","report.reimbursed","reimbursement.failed","reimbursement.reversed","reimbursement.cancelled","reimbursement.overpaid","reimbursement.receipt_confirmed","reimbursement.delayed","reimbursement.returned","expense.reimbursement_stopped","expense.created","expense.updated","expense.voided","expense.restored","expense.split","expense.duplicate_kept","expense.receipt_merged","expense.receipt_attached","expense.receipt_replaced","expense.corrected","expense.violation_dismissed","document.created","document.deleted","document.processed","document.failed","comment.added","comment.mentioned","report.participant_added","report.participant_removed","room.member_added","room.member_removed","task.created","task.reassigned","task.completed","task.reopened","document.shared","payment_account.assigned","payment_account.unassigned","payment_account.created","payment_account.archived","plaid.connected","plaid.reconnected","plaid.removed","card.feed_broken","transaction.matched","transaction.unmatched","report.exported","export.requested","integration.sync_failed","integration.needs_attention","travel.trip_changed","billing.subscription_changed","billing.seats_changed","member.role_changed","member.suspended","member.updated","invitation.created","invitation.accepted","workflow.created","workflow.updated","workflow.deleted","policy.created","policy.updated","policy.deleted","budget.created","budget.updated","budget.deleted","integration.connected","integration.disconnected","payee_bank_account.saved","payee_bank_account.removed","reimbursement.settings_saved"]}},"branches":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"when":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"$ref":"#/components/schemas/AgentField"},"op":{"$ref":"#/components/schemas/AgentOperator"},"value":{"anyOf":[{"type":"number"},{"type":"string","maxLength":200},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2}]}},"required":["field","op","value"]}},"ask":{"type":"string","maxLength":1000},"then":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"tool":{"$ref":"#/components/schemas/AgentStepTool"},"input":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"required":["tool"]}}},"required":["then"]}}},"required":["events","branches"]},"templateKey":{"type":"string","maxLength":40},"enabled":{"default":true,"type":"boolean"}},"required":["title","prompt","plan"]},"SavedPlaceInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"address":{"type":"string","minLength":1,"maxLength":200}},"required":["name","address"]},"SavedSearchInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"filters":{"default":{},"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/ExpenseStatus"},{"type":"array","items":{"$ref":"#/components/schemas/ExpenseStatus"}}]},"kind":{"$ref":"#/components/schemas/ExpenseKind"},"paymentType":{"$ref":"#/components/schemas/PaymentType"},"ownerId":{"type":"string"},"scope":{"default":"all","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"$ref":"#/components/schemas/ExpenseDateField"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200}}},"columns":{"minItems":1,"maxItems":15,"type":"array","items":{"$ref":"#/components/schemas/ExpenseColumn"}},"sort":{"$ref":"#/components/schemas/ExpenseSort"},"shared":{"type":"boolean"}},"required":["name"]},"ScheduledReportInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"$ref":"#/components/schemas/ScheduledReportKind"},"format":{"$ref":"#/components/schemas/ExportFormat"},"cadence":{"$ref":"#/components/schemas/ReportCadence"},"recipients":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"enabled":{"type":"boolean"},"filters":{"default":{},"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/ExpenseStatus"},{"type":"array","items":{"$ref":"#/components/schemas/ExpenseStatus"}}]},"kind":{"$ref":"#/components/schemas/ExpenseKind"},"paymentType":{"$ref":"#/components/schemas/PaymentType"},"ownerId":{"type":"string"},"scope":{"default":"all","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"$ref":"#/components/schemas/ExpenseDateField"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200}}}},"required":["name","kind","format","cadence","recipients"]},"SearchQuery":{"type":"object","properties":{"q":{"type":"string","minLength":1,"maxLength":200},"kind":{"$ref":"#/components/schemas/SearchKind"},"limit":{"default":5,"type":"integer","minimum":1,"maximum":50}},"required":["q"]},"AccountingShortcutQuery":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"accountId":{"type":"string"},"withdrawalType":{"type":"string","enum":["MANUAL","PAYROLL","ACH","ACH_FILE","ACH_PROVIDER"]},"groupBy":{"$ref":"#/components/schemas/AccrualGrouping"},"cursor":{"type":"string"}}},"CatalogReportQuery":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}},"SeatsRequest":{"type":"object","properties":{"seats":{"type":"integer","exclusiveMinimum":0,"maximum":100000}},"required":["seats"]},"SetClientCertificateEnforcementInput":{"type":"object","properties":{"required":{"type":"boolean"}},"required":["required"]},"SharePlaidItemInput":{"type":"object","properties":{"workspaceId":{"type":"string","minLength":1},"paymentAccountIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1}}},"required":["workspaceId","paymentAccountIds"]},"SlackSettingsInput":{"type":"object","properties":{"channelId":{"anyOf":[{"type":"string","minLength":1,"maxLength":100},{"type":"null"}]},"receipts":{"$ref":"#/components/schemas/SlackReceipts"}},"required":["channelId","receipts"]},"SplitExpenseInput":{"type":"object","properties":{"mode":{"default":"amount","type":"string","enum":["amount","percent","days"]},"parts":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"basisPoints":{"type":"integer","minimum":1,"maximum":10000},"categoryId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"tagIds":{"maxItems":100,"type":"array","items":{"type":"string"}},"reimbursable":{"type":"boolean"}}}},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}},"SsoEnforcementInput":{"type":"object","properties":{"enforced":{"type":"boolean"},"ownerExempt":{"type":"boolean"}},"required":["enforced"]},"StartDomainMigrationInput":{"type":"object","properties":{"toDomainId":{"type":"string","minLength":1},"dryRun":{"type":"boolean"}},"required":["toDomainId"]},"StartMergeInput":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["email"]},"SyncInput":{"type":"object","properties":{"expenseIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"reportId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"resend":{"type":"boolean"},"confirmDuplicate":{"type":"boolean"}}},"TaskListQuery":{"type":"object","properties":{"status":{"type":"string","enum":["OPEN","DONE"]},"mine":{"type":"string"}}},"TransferWorkspaceInput":{"type":"object","properties":{"memberId":{"type":"string","minLength":1}},"required":["memberId"]},"UnsubscribeInput":{"type":"object","properties":{"token":{"type":"string","minLength":16,"maxLength":500}},"required":["token"]},"UpdateAgentInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"description":{"type":"string","maxLength":500},"instructions":{"default":"","type":"string","maxLength":6000},"grants":{"default":[],"maxItems":60,"type":"array","items":{"type":"object","properties":{"tool":{"type":"string","minLength":1,"maxLength":64},"limits":{"type":"object","properties":{"maxTotalMinor":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}}},"required":["tool"]}}}},"UpdateAgentRuleInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"role":{"$ref":"#/components/schemas/AgentRuleRole"},"prompt":{"type":"string","minLength":1,"maxLength":6000},"plan":{"type":"object","properties":{"events":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"string","enum":["report.submitted","report.auto_approved","report.step_approved","report.approved","report.rejected","report.retracted","report.reopened","report.sent_back","report.expense_rejected","report.findings_accepted","expense.held","expense.released","report.created","report.updated","report.deleted","report.reassigned","report.closed","report.held_moved","report.expenses_added","report.expense_removed","report.approver_replaced","report.audit_sampled","report.moved","reimbursement.created","reimbursement.paid","report.reimbursed","reimbursement.failed","reimbursement.reversed","reimbursement.cancelled","reimbursement.overpaid","reimbursement.receipt_confirmed","reimbursement.delayed","reimbursement.returned","expense.reimbursement_stopped","expense.created","expense.updated","expense.voided","expense.restored","expense.split","expense.duplicate_kept","expense.receipt_merged","expense.receipt_attached","expense.receipt_replaced","expense.corrected","expense.violation_dismissed","document.created","document.deleted","document.processed","document.failed","comment.added","comment.mentioned","report.participant_added","report.participant_removed","room.member_added","room.member_removed","task.created","task.reassigned","task.completed","task.reopened","document.shared","payment_account.assigned","payment_account.unassigned","payment_account.created","payment_account.archived","plaid.connected","plaid.reconnected","plaid.removed","card.feed_broken","transaction.matched","transaction.unmatched","report.exported","export.requested","integration.sync_failed","integration.needs_attention","travel.trip_changed","billing.subscription_changed","billing.seats_changed","member.role_changed","member.suspended","member.updated","invitation.created","invitation.accepted","workflow.created","workflow.updated","workflow.deleted","policy.created","policy.updated","policy.deleted","budget.created","budget.updated","budget.deleted","integration.connected","integration.disconnected","payee_bank_account.saved","payee_bank_account.removed","reimbursement.settings_saved"]}},"branches":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"when":{"default":[],"maxItems":20,"type":"array","items":{"type":"object","properties":{"field":{"$ref":"#/components/schemas/AgentField"},"op":{"$ref":"#/components/schemas/AgentOperator"},"value":{"anyOf":[{"type":"number"},{"type":"string","maxLength":200},{"type":"boolean"},{"maxItems":100,"type":"array","items":{"type":"string","maxLength":200}},{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2}]}},"required":["field","op","value"]}},"ask":{"type":"string","maxLength":1000},"then":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"tool":{"$ref":"#/components/schemas/AgentStepTool"},"input":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"required":["tool"]}}},"required":["then"]}}},"required":["events","branches"]},"templateKey":{"type":"string","maxLength":40},"enabled":{"default":true,"type":"boolean"}}},"UpdateApiKeyInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyScopeName"}},"expiresAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"fullAccess":{"type":"boolean"},"managerIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":64}},"signingRequired":{"type":"boolean"}}},"UpdateBudgetInput":{"type":"object","properties":{"totalMinor":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},{"type":"null"}]},"perMemberMinor":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},{"type":"null"}]},"thresholds":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"integer","minimum":1,"maximum":1000}}}},"UpdateContactInput":{"type":"object","properties":{"firstName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"emails":{"maxItems":10,"type":"array","items":{"type":"string","maxLength":254}},"phones":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"mobile":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"fax":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"region":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"country":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}}},"UpdateCustomFieldInput":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","SELECT","BOOLEAN"]},"options":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"required":{"type":"boolean"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"UpdateDelegationInput":{"type":"object","properties":{"access":{"$ref":"#/components/schemas/DelegationAccess"}},"required":["access"]},"UpdateDocumentSettingsInput":{"type":"object","properties":{"duplicates":{"type":"object","properties":{"similarityPercent":{"anyOf":[{"type":"integer","minimum":75,"maximum":100},{"type":"null"}]},"amountToleranceMinor":{"type":"integer","minimum":0,"maximum":500},"dayWindow":{"type":"integer","minimum":0,"maximum":30},"rule":{"anyOf":[{"type":"object","properties":{"operator":{"type":"string","enum":["AND","OR"]},"fields":{"minItems":1,"maxItems":7,"type":"array","items":{"$ref":"#/components/schemas/DuplicateField"}}},"required":["operator","fields"]},{"type":"null"}]}},"required":["similarityPercent","amountToleranceMinor","dayWindow","rule"]},"lineItems":{"type":"object","properties":{"enabled":{"type":"boolean"},"limit":{"anyOf":[{"type":"integer","minimum":1,"maximum":500},{"type":"null"}]}},"required":["enabled","limit"]},"maxPages":{"type":"integer","minimum":1,"maximum":50},"cropDocument":{"type":"boolean"},"emailAttachments":{"type":"string","enum":["combine","separate"]},"fxRateDate":{"type":"string","enum":["receipt","submission"]},"asyncEnrichments":{"type":"array","items":{"$ref":"#/components/schemas/AsyncEnrichment"}},"customFields":{"maxItems":30,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,63}$"},"pattern":{"type":"string","minLength":1,"maxLength":200},"level":{"default":"document","type":"string","enum":["document","line"]}},"required":["name","pattern"]}}}},"UpdateDomainInput":{"type":"object","properties":{"joinPolicy":{"$ref":"#/components/schemas/DomainJoinPolicy"}},"required":["joinPolicy"]},"UpdateExportSettingsInput":{"type":"object","properties":{"preferredExporterId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"autoSync":{"type":"boolean"},"exportDate":{"type":"string","enum":["EXPENSE_DATE","LAST_EXPENSE","SUBMITTED","EXPORTED"]},"reimbursableEntity":{"type":"string","enum":["BILL","CHECK","JOURNAL_ENTRY","EXPENSE_REPORT"]},"companyCardEntity":{"type":"string","enum":["CREDIT_CARD","DEBIT_CARD","BILL","JOURNAL_ENTRY","EXPENSE_REPORT"]},"defaultVendorId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"cardMisc":{"type":"boolean"},"billStatus":{"type":"string","enum":["DRAFT","SUBMITTED","AUTHORISED"]},"autoCreateVendors":{"type":"boolean"},"autoCreateCustomers":{"type":"boolean"},"payableAccountId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"reimbursableTiming":{"type":"string","enum":["ON_APPROVAL","ON_REIMBURSEMENT"]},"exportMethod":{"type":"string","enum":["ACCRUAL","CASH"]},"syncReimbursed":{"type":"boolean"},"billPaymentAccountId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"postingCurrency":{"type":"string","enum":["HOME","ORIGINAL"]},"printLater":{"type":"boolean"},"nextOpenPeriod":{"type":"boolean"},"customFormId":{"anyOf":[{"type":"string","pattern":"^\\d{1,20}$"},{"type":"null"}]},"expenseReportApproval":{"type":"string","enum":["SUPERVISOR","ACCOUNTING","SUPERVISOR_AND_ACCOUNTING"]},"billApproval":{"anyOf":[{"type":"string","enum":["PENDING","APPROVED"]},{"type":"null"}]},"journalApproval":{"anyOf":[{"type":"string","enum":["PENDING","APPROVED"]},{"type":"null"}]},"enforceExpenseLimit":{"type":"boolean"}},"additionalProperties":false},"UpdateExportTemplateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"columns":{"minItems":1,"maxItems":60,"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":80},"formula":{"type":"string","maxLength":500}},"required":["key"]}},"shared":{"type":"boolean"}}},"UpdateImportSettingsInput":{"type":"object","properties":{"prefixCategories":{"type":"boolean"},"expenseClaimsOnly":{"type":"boolean"},"items":{"type":"boolean"},"taxes":{"type":"boolean"},"rebillCustomers":{"type":"boolean"},"dimensions":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":160},"additionalProperties":{"type":"string","enum":["OFF","TAGS","REPORT_FIELDS","EMPLOYEE_DEFAULT"]}},"intercompany":{"type":"boolean"},"customLists":{"maxItems":20,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"table":{"type":"string","pattern":"^custom(record|list)[a-z0-9_]{1,90}$"},"field":{"type":"string","pattern":"^(cseg|custcol|custbody)[a-z0-9_]{1,90}$"}},"required":["name","table","field"]}}},"additionalProperties":false},"UpdateMappingsInput":{"type":"object","properties":{"mappings":{"maxItems":5000,"type":"array","items":{"type":"object","properties":{"entity":{"$ref":"#/components/schemas/MappingEntity"},"localId":{"type":"string","minLength":1,"maxLength":100},"externalId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["entity","localId","externalId"]}}},"required":["mappings"]},"UpdateMileageRateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"unit":{"type":"string","enum":["mi","km"]},"rateMinor":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"effectiveFrom":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"effectiveTo":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"isDefault":{"type":"boolean"},"archived":{"type":"boolean"},"taxBasisPoints":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000},{"type":"null"}]},"taxReclaimableMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}}},"UpdateOAuthClientInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"uri":{"anyOf":[{"type":"string","maxLength":2000,"format":"uri"},{"type":"null"}]},"logoUri":{"anyOf":[{"type":"string","maxLength":2000,"format":"uri"},{"type":"null"}]},"redirectUris":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"scopes":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/OAuthScopeName"}},"enabled":{"type":"boolean"}}},"UpdatePaymentAccountInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"$ref":"#/components/schemas/PaymentAccountKind"},"brand":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"last4":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"isCompany":{"type":"boolean"},"ownerId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"archived":{"type":"boolean"},"transactionStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementCloseDay":{"anyOf":[{"type":"integer","minimum":1,"maximum":31},{"type":"null"}]},"liability":{"$ref":"#/components/schemas/CardLiability"},"reimbursable":{"type":["boolean","null"]},"allowDeletingTransactions":{"type":"boolean"},"glAccount":{"anyOf":[{"type":"string","minLength":1,"maxLength":60},{"type":"null"}]},"createExpenses":{"type":"boolean"}}},"UpdatePerDiemRateInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"country":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"region":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"amountMinor":{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"archived":{"type":"boolean"}}},"UpdatePolicyRuleInput":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/PolicyRuleType"},"severity":{"$ref":"#/components/schemas/PolicySeverity"},"enabled":{"type":"boolean"},"categoryId":{"type":["string","null"]},"amountMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000000000},{"type":"null"}]},"days":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":3650},{"type":"null"}]},"note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}},"UpdatePreferencesInput":{"type":"object","properties":{"preferences":{"minItems":1,"maxItems":29,"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["invoice.updated","document.processed","document.failed","expense.needs_review","report.submitted","report.approved","report.rejected","report.reimbursed","comment.added","member.invited","billing.payment_failed","billing.dispute_opened","billing.trial_ending","usage.limit_near","budget.threshold","fraud.duplicate_spike","integration.needs_attention","integration.post_failed","integration.batch_finished","mail_in.updated","chat.message","chat.mention","task.assigned","assistant.action","document.share_requested","export.ready","webhook.disabled","release.published","digest.daily"]},"email":{"type":"boolean"},"push":{"type":"boolean"},"inApp":{"type":"boolean"}},"required":["type"]}}},"required":["preferences"]},"UpdateProfileInput":{"type":"object","properties":{"displayName":{"type":"string","minLength":1,"maxLength":120},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"locale":{"type":"string","maxLength":20},"timezone":{"type":"string","maxLength":60},"distanceUnit":{"type":"string","enum":["mi","km"]},"defaultWorkspaceId":{"type":"string"},"onboarded":{"type":"boolean"},"language":{"$ref":"#/components/schemas/UiLanguage"},"highContrast":{"type":"boolean"},"pronouns":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"statusText":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"statusClearsAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}}},"UpdateRoomInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"visibility":{"$ref":"#/components/schemas/RoomVisibility"},"posting":{"$ref":"#/components/schemas/RoomPosting"},"imageAttachmentId":{"anyOf":[{"type":"string","minLength":1,"maxLength":64},{"type":"null"}]}}},"UpdateSavedSearchInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"filters":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/ExpenseStatus"},{"type":"array","items":{"$ref":"#/components/schemas/ExpenseStatus"}}]},"kind":{"$ref":"#/components/schemas/ExpenseKind"},"paymentType":{"$ref":"#/components/schemas/PaymentType"},"ownerId":{"type":"string"},"scope":{"default":"all","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"$ref":"#/components/schemas/ExpenseDateField"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200}}},"columns":{"anyOf":[{"minItems":1,"maxItems":15,"type":"array","items":{"$ref":"#/components/schemas/ExpenseColumn"}},{"type":"null"}]},"sort":{"anyOf":[{"$ref":"#/components/schemas/ExpenseSort"},{"type":"null"}]},"shared":{"type":"boolean"}}},"UpdateScheduledReportInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"kind":{"$ref":"#/components/schemas/ScheduledReportKind"},"format":{"$ref":"#/components/schemas/ExportFormat"},"cadence":{"$ref":"#/components/schemas/ReportCadence"},"recipients":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"enabled":{"type":"boolean"},"filters":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/ExpenseStatus"},{"type":"array","items":{"$ref":"#/components/schemas/ExpenseStatus"}}]},"kind":{"$ref":"#/components/schemas/ExpenseKind"},"paymentType":{"$ref":"#/components/schemas/PaymentType"},"ownerId":{"type":"string"},"scope":{"default":"all","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"$ref":"#/components/schemas/ExpenseDateField"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200}}}}},"ImportIifInput":{"type":"object","properties":{"uploadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["uploadId"]},"ReuseConnectorInput":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["connectionId"]},"SaveTravelDocumentInput":{"type":"object","properties":{"number":{"type":"string","minLength":4,"maxLength":40,"pattern":"^[A-Za-z0-9 -]+$"},"country":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"expiresOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}},"required":["number"]},"UpdateTravelProfileInput":{"type":"object","properties":{"legalFirstName":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"legalMiddleName":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"legalLastName":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"birthDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"gender":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"homeAddress":{"anyOf":[{"type":"object","properties":{"line1":{"type":"string","maxLength":120},"line2":{"type":"string","maxLength":120},"city":{"type":"string","maxLength":80},"region":{"type":"string","maxLength":80},"postalCode":{"type":"string","maxLength":20},"country":{"type":"string","maxLength":60}}},{"type":"null"}]},"workAddress":{"anyOf":[{"type":"object","properties":{"line1":{"type":"string","maxLength":120},"line2":{"type":"string","maxLength":120},"city":{"type":"string","maxLength":80},"region":{"type":"string","maxLength":80},"postalCode":{"type":"string","maxLength":20},"country":{"type":"string","maxLength":60}}},{"type":"null"}]},"emergencyName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"emergencyRelationship":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"emergencyPhone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"emergencyEmail":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]}},"additionalProperties":false},"UpdateStorageInput":{"type":"object","properties":{"backup":{"type":"boolean"},"exports":{"type":"boolean"},"intake":{"type":"boolean"}}},"UpdateTaskInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"assigneeId":{"type":"string","minLength":1,"maxLength":64}}},"UpdateVehicleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"plate":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"userId":{"type":"string"},"archived":{"type":"boolean"}}},"UpdateVendorInput":{"type":"object","properties":{"enabled":{"type":"boolean"},"name":{"type":"string","minLength":1,"maxLength":200},"email":{"anyOf":[{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"null"}]}}},"UseRecoveryCodeInput":{"type":"object","properties":{"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"code":{"type":"string","minLength":8,"maxLength":40}},"required":["email","code"]},"VacationDelegateInput":{"type":"object","properties":{"userId":{"type":"string","minLength":1},"delegateId":{"type":"string","minLength":1},"access":{"$ref":"#/components/schemas/DelegationAccess"},"startsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["userId","delegateId","endsAt"]},"VehicleInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"plate":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"userId":{"type":"string"},"archived":{"type":"boolean"}},"required":["name"]},"VendorAccountInput":{"type":"object","properties":{"accountId":{"anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]}},"required":["accountId"]},"VendorQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200}}},"VerifySenderInput":{"type":"object","properties":{"token":{"type":"string","minLength":16,"maxLength":200}},"required":["token"]},"WorkspaceSecurityInput":{"type":"object","properties":{"requireMfa":{"type":"boolean"}},"required":["requireMfa"]},"OffboardingQuery":{"type":"object","properties":{"userId":{"type":"string"}}},"ChatStreamQuery":{"type":"object","properties":{"lastEventId":{"description":"The same as the Last-Event-ID header.","type":"string"}}},"McpRequest":{"type":"object","properties":{"jsonrpc":{"type":"string","const":"2.0"},"id":{"description":"Left out on a notification, which answers 202.","anyOf":[{"type":"string"},{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}]},"method":{"type":"string","description":"initialize, tools/list, tools/call and so on."},"params":{"description":"What the method takes. On the current revision, `_meta` carries the protocol version and the client capabilities.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["jsonrpc","method"]},"JoinLinkQuery":{"type":"object","properties":{"token":{"type":"string"}}},"ChatThreadQuery":{"type":"object","properties":{"reportId":{"type":"string"},"expenseId":{"type":"string"}}},"PayeeAccountInput":{"anyOf":[{"type":"object","properties":{"holderName":{"type":"string","minLength":1,"maxLength":100},"routingNumber":{"type":"string"},"accountNumber":{"type":"string","pattern":"^[0-9A-Za-z-]{5,17}$"},"accountType":{"default":"CHECKING","$ref":"#/components/schemas/BankAccountType"}},"required":["holderName","routingNumber","accountNumber"]},{"type":"object","properties":{"holderName":{"type":"string","minLength":1,"maxLength":100},"routingNumber":{"type":"string"},"accountNumber":{"type":"string","pattern":"^[0-9A-Za-z-]{1,9}$"},"accountType":{"default":"CHECKING","$ref":"#/components/schemas/BankAccountType"}},"required":["holderName","routingNumber","accountNumber"]}]},"StatementPreviewFields":{"type":"object","properties":{"mapping":{"description":"The column mapping, as JSON text. Leave it out to use the suggested one. OFX and QFX need none.","type":"string"}}},"StatementUploadFields":{"type":"object","properties":{"force":{"type":"string"},"createExpenses":{"type":"string"},"reimbursable":{"type":"string"},"mapping":{"description":"The column mapping, as JSON text. Leave it out to use the suggested one. OFX and QFX need none.","type":"string"}}},"RemoveDeviceQuery":{"type":"object","properties":{"token":{"description":"The push token, for a client that cannot send a body on DELETE.","type":"string"}}},"UploadSourceQuery":{"type":"object","properties":{"client":{"description":"The app sending the file. Leave it out in a browser.","type":"string","enum":["ios","android"]}}},"OAuthAuthorizeQuery":{"type":"object","properties":{"response_type":{"type":"string","const":"code"},"client_id":{"type":"string","description":"A registered client id, or the URL of a client metadata document."},"redirect_uri":{"type":"string","description":"Exactly as registered."},"scope":{"description":"Scopes separated by spaces. `all` asks for every API scope.","type":"string"},"state":{"description":"Comes back unchanged on the redirect.","type":"string"},"code_challenge":{"type":"string","description":"43 characters of base64url: the SHA-256 of the verifier."},"code_challenge_method":{"type":"string","const":"S256"},"resource":{"description":"The API or the MCP server. A token for one is refused at the other.","type":"string"}},"required":["response_type","client_id","redirect_uri","code_challenge","code_challenge_method"]},"OAuthTokenForm":{"type":"object","properties":{"grant_type":{"type":"string","enum":["authorization_code","refresh_token"]},"code":{"description":"With authorization_code.","type":"string"},"redirect_uri":{"description":"With authorization_code: the same value sent to /oauth/authorize.","type":"string"},"code_verifier":{"description":"With authorization_code: 43 to 128 characters.","type":"string"},"refresh_token":{"description":"With refresh_token. It rotates: use the one each answer returns.","type":"string"},"scope":{"description":"With refresh_token: narrows what the new token holds. It cannot widen it.","type":"string"},"resource":{"description":"If sent, it must be the resource the code or token was issued for.","type":"string"},"client_id":{"description":"Unless sent by HTTP Basic.","type":"string"},"client_secret":{"description":"For a confidential client, unless sent by HTTP Basic.","type":"string"}},"required":["grant_type"]},"OAuthRevokeForm":{"type":"object","properties":{"token":{"type":"string","description":"The access or refresh token. Revoking a refresh token ends every token issued from it."},"client_id":{"description":"Unless sent by HTTP Basic.","type":"string"},"client_secret":{"description":"For a confidential client, unless sent by HTTP Basic.","type":"string"}},"required":["token"]},"OAuthClientMetadata":{"type":"object","properties":{"client_name":{"type":"string","minLength":1,"maxLength":100},"client_uri":{"type":"string","maxLength":2000,"format":"uri"},"logo_uri":{"type":"string","maxLength":2000,"format":"uri"},"redirect_uris":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"token_endpoint_auth_method":{"type":"string","enum":["none","client_secret_basic","client_secret_post"]},"application_type":{"type":"string","enum":["web","native"]},"scope":{"type":"string","maxLength":2000}},"required":["client_name","redirect_uris"]},"AnyDocumentInput":{"type":"object","properties":{"file_url":{"type":"string","minLength":1,"maxLength":2000},"file_data":{"type":"string","minLength":1},"file_name":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50}},"required":["blueprint_name"]},"BatchDocumentsInput":{"type":"object","properties":{"file_urls":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"type":{"$ref":"#/components/schemas/DocumentType"},"external_id":{"type":"string","maxLength":200}},"required":["file_urls"]},"BlueprintListQuery":{"type":"object","properties":{"documentType":{"$ref":"#/components/schemas/DocumentType"}}},"BlueprintVersionQuery":{"type":"object","properties":{"version":{"type":"integer","minimum":1,"maximum":9007199254740991}}},"ClassifyDocumentInput":{"type":"object","properties":{"file_url":{"type":"string","minLength":1,"maxLength":2000},"file_data":{"type":"string","minLength":1},"file_name":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}}}},"CreateBlueprintInput":{"type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"title":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","maxLength":300},"documentType":{"default":"OTHER","$ref":"#/components/schemas/DocumentType"},"schema":{"type":"object","properties":{"type":{"type":"string","const":"object"},"description":{"type":"string","maxLength":300},"properties":{"$ref":"#/components/schemas/SharedSchema0"}},"required":["type","properties"],"additionalProperties":false},"fields":{"default":[],"maxItems":150,"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":100},"example":{"type":"string","maxLength":200},"box":{"type":"object","properties":{"page":{"type":"integer","minimum":0,"maximum":49},"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1},"width":{"type":"number","minimum":0,"maximum":1},"height":{"type":"number","minimum":0,"maximum":1}},"required":["page","x","y","width","height"],"additionalProperties":false}},"required":["path"],"additionalProperties":false}}},"required":["name","title","schema"]},"CropDocumentInput":{"type":"object","properties":{"page":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1},"width":{"type":"number","exclusiveMinimum":0,"maximum":1},"height":{"type":"number","exclusiveMinimum":0,"maximum":1}},"required":["x","y","width","height"]},"ExtractDocumentInput":{"type":"object","properties":{"file_url":{"type":"string","minLength":1,"maxLength":2000},"file_data":{"type":"string","minLength":1},"file_name":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}}}},"ParseDocumentInput":{"type":"object","properties":{"file_url":{"type":"string","minLength":1,"maxLength":2000},"file_data":{"type":"string","minLength":1},"file_name":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200},"async":{"type":"boolean"},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"auto_delete":{"type":"boolean"},"details":{"type":"boolean"}}},"ParseQuery":{"type":"object","properties":{"details":{"type":"boolean"},"tag":{"type":"string","maxLength":80}}},"ParseUpdateInput":{"type":"object","properties":{"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}}}},"RotateDocumentInput":{"type":"object","properties":{"page":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991},"degrees":{"default":-90,"anyOf":[{"type":"number","const":90},{"type":"number","const":180},{"type":"number","const":270},{"type":"number","const":-90}]}}},"SettleDuplicatesInput":{"oneOf":[{"type":"object","properties":{"keep":{"type":"string","const":"all"},"others":{"default":[],"maxItems":20,"type":"array","items":{"type":"string"}}},"required":["keep"]},{"type":"object","properties":{"keep":{"type":"string","const":"selected"},"discard":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string"}},"values":{"default":{},"type":"object","properties":{"merchantName":{"type":"string","minLength":1,"maxLength":255},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000}}}},"required":["keep","discard"]}]},"SplitDocumentInput":{"type":"object","properties":{"mode":{"type":"string","enum":["every_page","custom","detect","blank_pages"]},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"}},"required":["mode"]},"SplitOptions":{"type":"object","properties":{"split_by_blank_page":{"type":"boolean"},"every_page":{"type":"boolean"},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"},"document_types":{"minItems":2,"maxItems":50,"type":"array","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9 _-]{0,62}[a-z0-9]$"}},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"file_url":{"type":"string","minLength":1,"maxLength":2000},"file_data":{"type":"string","minLength":1},"file_name":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200}}},"SplitUploadInput":{"type":"object","properties":{"uploadId":{"type":"string","minLength":1},"mode":{"default":"detect","type":"string","enum":["every_page","custom","detect","blank_pages"]},"ranges":{"type":"string","pattern":"^\\d+(-\\d+)?(\\s*,\\s*\\d+(-\\d+)?)*$"}},"required":["uploadId"]},"UpdateBlueprintInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":120},"description":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}]},"documentType":{"$ref":"#/components/schemas/DocumentType"},"schema":{"type":"object","properties":{"type":{"type":"string","const":"object"},"description":{"type":"string","maxLength":300},"properties":{"$ref":"#/components/schemas/SharedSchema0"}},"required":["type","properties"],"additionalProperties":false},"fields":{"maxItems":150,"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":100},"example":{"type":"string","maxLength":200},"box":{"type":"object","properties":{"page":{"type":"integer","minimum":0,"maximum":49},"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1},"width":{"type":"number","minimum":0,"maximum":1},"height":{"type":"number","minimum":0,"maximum":1}},"required":["page","x","y","width","height"],"additionalProperties":false}},"required":["path"],"additionalProperties":false}}}},"CreateWorkflowInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"graph":{"type":"object","properties":{"nodes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"},"type":{"type":"string","enum":["api_import","document_aggregator","google_drive_import","gmail_input","dropbox_import","email_collector","ai_agent","convert_csv","convert_excel","decision","document_classifier","email_approval","extract_data","extract_data_set","pdf_splitter","split_collector","business_insights","email_file","google_drive","dropbox","google_sheets","xero_export"]},"x":{"type":"number","minimum":-100000,"maximum":100000},"y":{"type":"number","minimum":-100000,"maximum":100000},"config":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","x","y"]}},"edges":{"maxItems":300,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"},"from":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"},"port":{"type":"string","minLength":1,"maxLength":80},"to":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"}},"required":["id","from","port","to"]}}},"required":["nodes","edges"]}},"required":["name"]},"UpdateWorkflowInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"graph":{"type":"object","properties":{"nodes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"},"type":{"type":"string","enum":["api_import","document_aggregator","google_drive_import","gmail_input","dropbox_import","email_collector","ai_agent","convert_csv","convert_excel","decision","document_classifier","email_approval","extract_data","extract_data_set","pdf_splitter","split_collector","business_insights","email_file","google_drive","dropbox","google_sheets","xero_export"]},"x":{"type":"number","minimum":-100000,"maximum":100000},"y":{"type":"number","minimum":-100000,"maximum":100000},"config":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","x","y"]}},"edges":{"maxItems":300,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"},"from":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"},"port":{"type":"string","minLength":1,"maxLength":80},"to":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"}},"required":["id","from","port","to"]}}},"required":["nodes","edges"]}}},"ValidateWorkflowInput":{"type":"object","properties":{"graph":{"type":"object","properties":{"nodes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"},"type":{"type":"string","enum":["api_import","document_aggregator","google_drive_import","gmail_input","dropbox_import","email_collector","ai_agent","convert_csv","convert_excel","decision","document_classifier","email_approval","extract_data","extract_data_set","pdf_splitter","split_collector","business_insights","email_file","google_drive","dropbox","google_sheets","xero_export"]},"x":{"type":"number","minimum":-100000,"maximum":100000},"y":{"type":"number","minimum":-100000,"maximum":100000},"config":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","x","y"]}},"edges":{"maxItems":300,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"},"from":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"},"port":{"type":"string","minLength":1,"maxLength":80},"to":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"}},"required":["id","from","port","to"]}}},"required":["nodes","edges"]}}},"StartWorkflowRunInput":{"type":"object","properties":{"uploadId":{"type":"string","minLength":1},"documentIds":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1}},"nodeId":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"}}},"AnswerWorkflowStepInput":{"type":"object","properties":{"decision":{"type":"string","enum":["approve","reject"]}},"required":["decision"]},"WorkflowApprovalTokenInput":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":2000}},"required":["token"]},"AnalyticsQuery":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/ExpenseStatus"},{"type":"array","items":{"$ref":"#/components/schemas/ExpenseStatus"}}]},"kind":{"$ref":"#/components/schemas/ExpenseKind"},"paymentType":{"$ref":"#/components/schemas/PaymentType"},"ownerId":{"type":"string"},"scope":{"default":"all","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"$ref":"#/components/schemas/ExpenseDateField"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200},"limit":{"default":50,"type":"integer","minimum":1,"maximum":200},"interval":{"default":"month","$ref":"#/components/schemas/TrendInterval"},"groupCurrency":{"type":"string","pattern":"^[A-Z]{3}$"}}},"ApproveReportInput":{"type":"object","properties":{"comment":{"type":"string","maxLength":2000},"held":{"default":"move","type":"string","enum":["move","approve"]},"bypass":{"default":false,"type":"boolean"},"expectedTotalMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000}}},"AttachReceiptInput":{"type":"object","properties":{"mode":{"default":"add","type":"string","enum":["add","replace"]},"clientId":{"type":"string","minLength":8,"maxLength":255},"deviceId":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"}}},"BulkDocumentInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}},"filter":{"$ref":"#/components/schemas/DocumentListQuery"},"cursor":{"type":"string"},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"move"},"folderId":{"type":["string","null"]}},"required":["type","folderId"]},{"type":"object","properties":{"type":{"type":"string","const":"set_type"},"documentType":{"$ref":"#/components/schemas/DocumentType"}},"required":["type","documentType"]},{"type":"object","properties":{"type":{"type":"string","const":"archive"},"archived":{"type":"boolean"}},"required":["type","archived"]},{"type":"object","properties":{"type":{"type":"string","const":"delete"}},"required":["type"]}]}},"required":["action"]},"TrashActionInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string"}},"all":{"type":"boolean"},"action":{"type":"string","enum":["restore","purge"]}},"required":["action"]},"BulkExpenseInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string"}},"action":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","const":"set_category"},"categoryId":{"type":["string","null"]}},"required":["type","categoryId"]},{"type":"object","properties":{"type":{"type":"string","const":"set_project"},"projectId":{"type":["string","null"]}},"required":["type","projectId"]},{"type":"object","properties":{"type":{"type":"string","const":"add_tag"},"tagId":{"type":"string"}},"required":["type","tagId"]},{"type":"object","properties":{"type":{"type":"string","const":"set_billable"},"billable":{"type":"boolean"}},"required":["type","billable"]},{"type":"object","properties":{"type":{"type":"string","const":"set_reimbursable"},"reimbursable":{"type":"boolean"}},"required":["type","reimbursable"]},{"type":"object","properties":{"type":{"type":"string","const":"add_to_report"},"reportId":{"type":"string"}},"required":["type","reportId"]},{"type":"object","properties":{"type":{"type":"string","const":"mark_reviewed"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"void"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","const":"restore"}},"required":["type"]}]}},"required":["ids","action"]},"BulkReassignInput":{"type":"object","properties":{"reportIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1}},"approverId":{"type":"string","minLength":1},"mode":{"default":"replace","type":"string","enum":["replace","insert"]}},"required":["reportIds","approverId"]},"BulkApproveInput":{"type":"object","properties":{"reportIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1}},"all":{"type":"boolean"}},"required":["reportIds"]},"BulkReportsInput":{"type":"object","properties":{"reportIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1}}},"required":["reportIds"]},"CatalogImportInput":{"type":"object","properties":{"csv":{"type":"string","minLength":1}},"required":["csv"]},"CatalogQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200},"archived":{"type":"string"}}},"CategoryInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"parentId":{"type":["string","null"]},"glCode":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"taxLine":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]},"deductiblePct":{"type":"integer","minimum":0,"maximum":100},"enabled":{"type":"boolean"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"$ref":"#/components/schemas/CategoryType"},"payrollCode":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"descriptionHint":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"approverId":{"type":["string","null"]},"commentRequired":{"type":"boolean"},"maxExpenseMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000000000},{"type":"null"}]},"headerOnly":{"type":"boolean"}},"required":["name"]},"CategoryQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200},"enabled":{"type":"string"},"type":{"$ref":"#/components/schemas/CategoryType"},"origin":{"$ref":"#/components/schemas/CategoryOrigin"},"headers":{"type":"string"}}},"CommentInput":{"type":"object","properties":{"body":{"default":"","type":"string","maxLength":15000},"mentions":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"attachmentIds":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1}}}},"ContactExportInput":{"type":"object","properties":{"format":{"$ref":"#/components/schemas/ContactExportFormat"},"ids":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string"}}},"required":["format"]},"ContactListQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200},"documentId":{"type":"string"},"name":{"type":"string","maxLength":200},"company":{"type":"string","maxLength":200},"email":{"type":"string","maxLength":254},"phone":{"type":"string","maxLength":40},"website":{"type":"string","maxLength":300},"city":{"type":"string","maxLength":120},"region":{"type":"string","maxLength":120},"postalCode":{"type":"string","maxLength":20},"country":{"type":"string","maxLength":120}}},"CreateDocumentInput":{"type":"object","properties":{"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"categories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"taxonomy":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"allowed_async_enrichments":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/AsyncEnrichment"}},"bounding_boxes":{"type":"boolean"},"confidence_details":{"type":"boolean"},"compute":{"type":"boolean"},"parse_address":{"type":"boolean"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50},"boost_mode":{"type":"boolean"},"auto_delete":{"type":"boolean"},"stitch":{"type":"boolean"},"crop_document":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"async":{"type":"boolean"},"line_item_expansion":{"type":"boolean"},"tiff_dpi":{"type":"number"},"type":{"default":"RECEIPT","$ref":"#/components/schemas/DocumentType"},"clientId":{"type":"string","minLength":8,"maxLength":255},"externalId":{"type":"string","maxLength":200},"folderId":{"type":"string"},"notes":{"type":"string","maxLength":2000},"capturedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"locationAccuracyM":{"type":"number","minimum":0},"deviceId":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"},"merchantName":{"type":"string","minLength":1,"maxLength":255},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"totalMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"taxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"category":{"type":"string","minLength":1,"maxLength":120}}},"CreateExpenseInput":{"type":"object","properties":{"merchantName":{"type":["string","null"]},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"tipMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"shippingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"baseAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"fxRate":{"anyOf":[{"type":"number","minimum":1e-8,"maximum":9999999999},{"type":"null"}]},"categoryId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"anyOf":[{"$ref":"#/components/schemas/PaymentType"},{"type":"null"}]},"paymentAccountId":{"type":["string","null"]},"cardLast4":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"invoiceNumber":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"poNumber":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"mcc":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"taxDeductible":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"alsoCategoryIds":{"maxItems":10,"type":"array","items":{"type":"string"}},"tagIds":{"type":"array","items":{"type":"string"}},"attendees":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[+\\d][\\d\\s().-]*$"}},"required":["name"]}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lines":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseLineInput"}},"kind":{"default":"MANUAL","type":"string","enum":["MANUAL","MILEAGE","PER_DIEM","TIME"]},"quantity":{"type":"number","exclusiveMinimum":0},"rateMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"unit":{"type":"string","maxLength":10},"trip":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"vehicleId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"ownerId":{"type":"string","minLength":1},"reportId":{"type":"string","minLength":1}},"required":["date","amountMinor"]},"CreateExportInput":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/ExportKind"},"format":{"$ref":"#/components/schemas/ExportFormat"},"filters":{"default":{},"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/ExpenseStatus"},{"type":"array","items":{"$ref":"#/components/schemas/ExpenseStatus"}}]},"kind":{"$ref":"#/components/schemas/ExpenseKind"},"paymentType":{"$ref":"#/components/schemas/PaymentType"},"ownerId":{"type":"string"},"scope":{"default":"all","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"$ref":"#/components/schemas/ExpenseDateField"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200},"ids":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string"}},"year":{"type":"integer","minimum":2000,"maximum":2100},"reportState":{"anyOf":[{"$ref":"#/components/schemas/ReportStatus"},{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/ReportStatus"}}]},"reportIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","minLength":1}},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"approvedAfter":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"exported":{"type":"boolean"},"categoryIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1}},"documentIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","minLength":1}},"documentTypes":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/DocumentType"}},"policyIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1}}}},"templateId":{"type":"string"},"fullPageReceipts":{"type":"boolean"},"template":{"type":"string","minLength":1,"maxLength":20000},"onFinish":{"type":"object","properties":{"email":{"type":"object","properties":{"recipients":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"message":{"type":"string","minLength":1,"maxLength":1000}},"required":["recipients"]},"markAsExported":{"type":"boolean"},"sftpUpload":{"type":"object","properties":{"host":{"type":"string","minLength":1,"maxLength":253},"port":{"default":22,"type":"integer","minimum":1,"maximum":65535},"username":{"type":"string","minLength":1,"maxLength":256},"password":{"type":"string","minLength":1,"maxLength":1024},"privateKey":{"type":"string","minLength":1,"maxLength":16384},"passphrase":{"type":"string","minLength":1,"maxLength":1024},"hostKeySha256":{"type":"string","pattern":"^(SHA256:)?[A-Za-z0-9+/]{43}=?$"},"path":{"default":".","type":"string","minLength":1,"maxLength":1024}},"required":["host","username","hostKeySha256"]}}},"delimiter":{"$ref":"#/components/schemas/CsvDelimiter"},"bom":{"type":"boolean"},"recipients":{"maxItems":10,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"columnSet":{"$ref":"#/components/schemas/DocumentColumnSet"},"preset":{"$ref":"#/components/schemas/ExportPreset"},"view":{"type":"object","properties":{"level":{"default":"expense","type":"string","enum":["expense","report"]},"columns":{"minItems":1,"maxItems":60,"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":80}},"required":["key"]}},"sort":{"$ref":"#/components/schemas/ExpenseSort"},"groupBy":{"$ref":"#/components/schemas/ExpenseGroupBy"},"groupsOnly":{"type":"boolean"}},"required":["columns"]}},"required":["kind","format"]},"CreateMerchantInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"defaultCategoryId":{"type":["string","null"]},"website":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"taxId":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"is1099":{"type":"boolean"},"merchantType":{"anyOf":[{"$ref":"#/components/schemas/MerchantType"},{"type":"null"}]}},"required":["name"]},"CreatePerDiemInput":{"type":"object","properties":{"perDiemRateId":{"type":"string","minLength":1},"mieRateId":{"type":"string","minLength":1},"subRates":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"rateId":{"type":"string","minLength":1},"quantity":{"type":"integer","exclusiveMinimum":0,"maximum":366}},"required":["rateId","quantity"]}},"lodgingRateId":{"type":"string","minLength":1},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"startTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"partialDays":{"default":true,"type":"boolean"},"destination":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"mealsCategoryId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"tagIds":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1}},"categoryId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}},"required":["startDate","endDate"]},"CreateReportInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"purpose":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"expenseIds":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1}},"ownerId":{"type":"string","minLength":1}}},"CreateTimeInput":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"hours":{"type":"number","exclusiveMinimum":0,"maximum":10000},"rateMinor":{"type":"integer","exclusiveMinimum":0,"maximum":10000000000000},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"description":{"type":"string","minLength":1,"maxLength":1000},"categoryId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}},"required":["date","hours","rateMinor","description"]},"CreateTripInput":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"distance":{"type":"number","exclusiveMinimum":0,"maximum":100000},"odometerStart":{"type":"number","minimum":0,"maximum":10000000},"odometerEnd":{"type":"number","minimum":0,"maximum":10000000},"routeDistance":{"anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":100000},{"type":"null"}]},"roundTrip":{"default":false,"type":"boolean"},"origin":{"type":"string","minLength":1,"maxLength":200},"destination":{"type":"string","minLength":1,"maxLength":200},"stops":{"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"departed":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"arrived":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"purpose":{"type":"string","minLength":1,"maxLength":500},"vehicleId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"rateId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"routeToken":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"null"}]},"categoryId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"projectId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"clientId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]}},"required":["date","origin","destination","purpose"]},"CreateWebhookInput":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000},"description":{"type":"string","maxLength":200},"events":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"apiKeyId":{"type":"string","minLength":1,"maxLength":64}},"required":["url","events"]},"ConfirmWebhookInput":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":200}},"required":["token"]},"WebhookListQuery":{"type":"object","properties":{"apiKeyId":{"type":"string","minLength":1,"maxLength":64},"include":{"type":"string","enum":["keys"]}}},"DocumentListQuery":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/DocumentType"},"status":{"$ref":"#/components/schemas/DocumentStatus"},"source":{"$ref":"#/components/schemas/DocumentSource"},"source_id":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"owner":{"type":"string","maxLength":100},"device_id":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"},"device_user_uuid":{"type":"string","maxLength":100},"viewed":{"type":"boolean"},"trashed":{"type":"boolean"},"envelope":{"type":"string"},"created__gt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"created__gte":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"created__lt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"created__lte":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"updated__gt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"updated__gte":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"updated__lt":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"updated__lte":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}]},"issued":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"issued__gt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"issued__gte":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"issued__lt":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"issued__lte":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total__gt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total__gte":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total__lt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total__lte":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax__gt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax__gte":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax__lt":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"tax__lte":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"category":{"type":"string","maxLength":120},"vendor":{"type":"string","maxLength":200},"notes":{"type":"string","maxLength":200},"payment_type":{"$ref":"#/components/schemas/PaymentType"},"last_four_digits":{"type":"string","pattern":"^\\d{4}$"},"first_name":{"type":"string","maxLength":200},"last_name":{"type":"string","maxLength":200},"work_phone":{"type":"string","maxLength":40},"cell_phone":{"type":"string","maxLength":40},"company":{"type":"string","maxLength":200},"email":{"type":"string","maxLength":200},"website":{"type":"string","maxLength":200},"country":{"type":"string","maxLength":80},"state":{"type":"string","maxLength":120},"city":{"type":"string","maxLength":120},"zip":{"type":"string","maxLength":20},"name":{"type":"string","maxLength":200},"is_empty":{"type":"string","maxLength":400},"order_by":{"$ref":"#/components/schemas/DocumentOrder"},"folderId":{"type":"string"},"mailInBatchId":{"type":"string"},"setId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"tag":{"type":"string","maxLength":80},"archived":{"type":"boolean"},"unviewed":{"type":"boolean"},"q":{"type":"string","maxLength":200},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"fraudColor":{"$ref":"#/components/schemas/FraudColor"},"fraudSignal":{"$ref":"#/components/schemas/FraudSignal"},"fraudReview":{"$ref":"#/components/schemas/FraudReviewState"}}},"ExpenseListPageQuery":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/ExpenseStatus"},{"type":"array","items":{"$ref":"#/components/schemas/ExpenseStatus"}}]},"kind":{"$ref":"#/components/schemas/ExpenseKind"},"paymentType":{"$ref":"#/components/schemas/PaymentType"},"ownerId":{"type":"string"},"scope":{"default":"mine","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"$ref":"#/components/schemas/ExpenseDateField"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200},"sort":{"$ref":"#/components/schemas/ExpenseSort"}}},"ExpenseTotalsQuery":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/ExpenseStatus"},{"type":"array","items":{"$ref":"#/components/schemas/ExpenseStatus"}}]},"kind":{"$ref":"#/components/schemas/ExpenseKind"},"paymentType":{"$ref":"#/components/schemas/PaymentType"},"ownerId":{"type":"string"},"scope":{"default":"mine","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"$ref":"#/components/schemas/ExpenseDateField"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200},"ids":{"anyOf":[{"type":"string","minLength":1},{"maxItems":500,"type":"array","items":{"type":"string","minLength":1}}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"}}},"FolderInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"parentId":{"type":["string","null"]}},"required":["name"]},"FolderQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200},"parentId":{"type":"string"}}},"DismissFlagInput":{"type":"object","properties":{"reason":{"type":"string","maxLength":500}}},"HoldExpenseInput":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"ReachMentionedInput":{"type":"object","properties":{"userIds":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","maxLength":64}}},"required":["userIds"]},"MergeMerchantInput":{"type":"object","properties":{"intoId":{"type":"string","minLength":1}},"required":["intoId"]},"MerchantInput":{"type":"object","properties":{"name":{"type":"string","minLength":1},"defaultCategoryId":{"type":["string","null"]},"website":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"taxId":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"is1099":{"type":"boolean"},"merchantType":{"anyOf":[{"$ref":"#/components/schemas/MerchantType"},{"type":"null"}]}}},"MileageLogQuery":{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"scope":{"default":"mine","type":"string","enum":["mine","all"]},"ownerId":{"type":"string"},"vehicleId":{"type":"string"},"purpose":{"$ref":"#/components/schemas/MileagePurpose"}}},"OdometerPhotoInput":{"type":"object","properties":{"reading":{"type":"string","enum":["START","END"]}},"required":["reading"]},"ProjectInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"code":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"clientId":{"type":["string","null"]},"budgetMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000000000},{"type":"null"}]},"archived":{"type":"boolean"}},"required":["name"]},"ProjectQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200},"archived":{"type":"string"},"clientId":{"type":"string"}}},"ReassignReportInput":{"type":"object","properties":{"approverId":{"type":"string","minLength":1},"mode":{"default":"replace","type":"string","enum":["replace","insert"]}},"required":["approverId"]},"RejectExpenseInput":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":2000}},"required":["reason"]},"RejectReportInput":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":2000},"to":{"type":"string","minLength":1}},"required":["reason"]},"ReportExpensesInput":{"type":"object","properties":{"ids":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1}}},"required":["ids"]},"ReportListQuery":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/ReportStatus"},{"type":"array","items":{"$ref":"#/components/schemas/ReportStatus"}}]},"scope":{"default":"mine","type":"string","enum":["mine","all","assigned"]},"ownerId":{"type":"string"},"q":{"type":"string","maxLength":200},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}},"ReportParticipantInput":{"type":"object","properties":{"userId":{"type":"string","minLength":1}},"required":["userId"]},"SubmitReportInput":{"type":"object","properties":{"memo":{"type":"string","maxLength":2000},"cc":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1}},"to":{"type":"string","minLength":1},"ccEmails":{"maxItems":10,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"attachPdf":{"type":"boolean"},"approverEmail":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}}},"SubmitDocumentInput":{"type":"object","properties":{"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"categories":{"maxItems":200,"type":"array","items":{"type":"string","minLength":1,"maxLength":120}},"taxonomy":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":300}},"allowed_async_enrichments":{"maxItems":10,"type":"array","items":{"$ref":"#/components/schemas/AsyncEnrichment"}},"bounding_boxes":{"type":"boolean"},"confidence_details":{"type":"boolean"},"compute":{"type":"boolean"},"parse_address":{"type":"boolean"},"country":{"type":"string","pattern":"^[A-Z]{2}$"},"max_pages_to_process":{"type":"integer","minimum":1,"maximum":50},"boost_mode":{"type":"boolean"},"auto_delete":{"type":"boolean"},"stitch":{"type":"boolean"},"crop_document":{"type":"boolean"},"blueprint_name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"blueprint_version":{"type":"integer","minimum":1,"maximum":9007199254740991},"async":{"type":"boolean"},"line_item_expansion":{"type":"boolean"},"tiff_dpi":{"type":"number"},"file_url":{"type":"string","minLength":1,"maxLength":2000},"file_urls":{"minItems":1,"maxItems":15,"type":"array","items":{"type":"string","minLength":1,"maxLength":2000}},"file_data":{"type":"string","minLength":1},"file_name":{"type":"string","maxLength":255},"external_id":{"type":"string","maxLength":200},"device_id":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"},"type":{"default":"RECEIPT","$ref":"#/components/schemas/DocumentType"},"bucket":{"type":"string","pattern":"^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$"},"package_path":{"type":"string","minLength":1,"maxLength":1024}}},"TagInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"groupName":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"glCode":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"archived":{"type":"boolean"},"approverId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"parentId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}},"required":["name"]},"TaxSummaryQuery":{"type":"object","properties":{"year":{"type":"integer","minimum":2000,"maximum":2100}}},"TripRouteQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200}}},"UpdateCategoryInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"parentId":{"type":["string","null"]},"glCode":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"taxLine":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}]},"deductiblePct":{"type":"integer","minimum":0,"maximum":100},"enabled":{"type":"boolean"},"position":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"type":{"$ref":"#/components/schemas/CategoryType"},"payrollCode":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"descriptionHint":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"approverId":{"type":["string","null"]},"commentRequired":{"type":"boolean"},"maxExpenseMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000000000},{"type":"null"}]},"headerOnly":{"type":"boolean"}}},"UpdateDocumentInput":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/DocumentType"},"folderId":{"type":["string","null"]},"title":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"tags":{"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"status":{"type":"string","enum":["PROCESSED","REVIEWED"]},"approved":{"type":"boolean"},"fraudReview":{"$ref":"#/components/schemas/FraudReviewInput"},"billable":{"type":"boolean"},"merchantName":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"totalMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"tipMinor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"customFields":{"type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"maxItems":50,"type":"array","items":{"type":"string","maxLength":2000}},{"type":"null"}]}},"corrections":{"type":"object","propertyNames":{"type":"string","enum":["vendor.address","vendor.phoneNumber","vendor.faxNumber","vendor.email","vendor.web","vendor.vatNumber","vendor.regNumber","vendor.abnNumber","vendor.orderNumber","billTo.name","billTo.address","billTo.email","billTo.phoneNumber","shipTo.name","shipTo.address","payment.terms","orderDate","shipDate","deliveryDate","serviceStartDate","serviceEndDate","deliveryNoteNumber","trackingNumber","incoterms","licensePlateNumber","vinNumber","storeNumber","serverName","folio.arrivalDate","folio.departureDate","folio.roomNumber","folio.guestName","folio.confirmationNumber"]},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}},"UpdateExpenseInput":{"type":"object","properties":{"merchantName":{"type":["string","null"]},"description":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"tipMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"shippingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"baseAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"fxRate":{"anyOf":[{"type":"number","minimum":1e-8,"maximum":9999999999},{"type":"null"}]},"categoryId":{"type":["string","null"]},"projectId":{"type":["string","null"]},"clientId":{"type":["string","null"]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"anyOf":[{"$ref":"#/components/schemas/PaymentType"},{"type":"null"}]},"paymentAccountId":{"type":["string","null"]},"cardLast4":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"invoiceNumber":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"poNumber":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"mcc":{"anyOf":[{"type":"string","pattern":"^\\d{4}$"},{"type":"null"}]},"taxDeductible":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"alsoCategoryIds":{"maxItems":10,"type":"array","items":{"type":"string"}},"tagIds":{"type":"array","items":{"type":"string"}},"attendees":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","minLength":3,"maxLength":40,"pattern":"^[+\\d][\\d\\s().-]*$"}},"required":["name"]}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"lines":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseLineInput"}}}},"UpdateFolderInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"parentId":{"type":["string","null"]}}},"UpdateProjectInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"code":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"clientId":{"type":["string","null"]},"budgetMinor":{"anyOf":[{"type":"integer","minimum":0,"maximum":10000000000000},{"type":"null"}]},"archived":{"type":"boolean"}}},"UpdateReportInput":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":100},"purpose":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"currency":{"type":"string","pattern":"^[A-Z]{3}$"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}}}},"UpdateTagInput":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"groupName":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"glCode":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}]},"archived":{"type":"boolean"},"approverId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"parentId":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]}}},"UpdateWebhookInput":{"type":"object","properties":{"url":{"type":"string","minLength":1,"maxLength":2000},"description":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"events":{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"enabled":{"type":"boolean"}}},"VehicleQuery":{"type":"object","properties":{"q":{"type":"string","maxLength":200},"archived":{"type":"string"},"userId":{"type":"string"}}},"BlockDeviceInput":{"type":"object","properties":{"deviceId":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[\\w.:-]+$"},"reason":{"type":"string","maxLength":500}},"required":["deviceId"]},"FraudReviewInput":{"type":"object","properties":{"decision":{"$ref":"#/components/schemas/FraudReviewDecision"},"types":{"default":[],"maxItems":25,"type":"array","items":{"$ref":"#/components/schemas/FraudSignal"}},"note":{"type":"string","maxLength":2000}},"required":["decision"]},"RevealDocumentInput":{"type":"object","properties":{"kinds":{"maxItems":6,"type":"array","items":{"$ref":"#/components/schemas/SensitiveKind"}},"reason":{"type":"string","maxLength":500}}},"CheckWithDocumentInput":{"type":"object","properties":{"check":{"$ref":"#/components/schemas/SubmitDocumentInput"},"document":{"$ref":"#/components/schemas/SubmitDocumentInput"}},"required":["check","document"]},"BillingInvoicePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BillingInvoice"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ExportRecordPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ExportRecord"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ExportRecordsAppended":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ExportRecord"}},"alreadyRecorded":{"type":"number","description":"Already recorded, so left as they were."}},"required":["data","alreadyRecorded"]},"DocumentDetail":{"type":"object","properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/DocumentType"},"source":{"$ref":"#/components/schemas/DocumentSource"},"status":{"$ref":"#/components/schemas/DocumentStatus"},"originalFilename":{"type":["string","null"]},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"},"pageCount":{"type":"number"},"externalId":{"type":["string","null"]},"folderId":{"type":["string","null"]},"expenseId":{"type":["string","null"]},"mailInBatchId":{"type":["string","null"]},"title":{"type":["string","null"]},"notes":{"type":["string","null"]},"latitude":{"description":"Where the device said it was when the photo was taken.","type":["number","null"]},"longitude":{"type":["number","null"]},"locationAccuracyM":{"type":["number","null"]},"duplicateOfId":{"type":["string","null"]},"processingError":{"type":["string","null"]},"processingErrorCode":{"anyOf":[{"type":"string","enum":["FILE_ENCRYPTED"]},{"type":"null"}],"description":"Set when the failure is one the file's owner can fix. processingError says what to do."},"verification":{"type":"string"},"capturedAt":{"type":["string","null"]},"processedAt":{"type":["string","null"]},"viewedAt":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"uploadedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"url":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all."},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}],"description":"Null when the page is not one, and for a caller without expenses.read_all."},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all. Value null means nothing could say."},"language":{"type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]}},"ocrScore":{"type":["number","null"]},"isFront":{"description":"A check: the front or the back.","type":["boolean","null"]},"tiffRejectScore":{"description":"A check: 0 is a clean clearing image and 1 is one a bank would send back.","type":["number","null"]},"tiffUpscaled":{"description":"A check: the photo was under 240 DPI, so the clearing image was enlarged.","type":["boolean","null"]}},"required":["index","url","thumbnailUrl","width","height","isBlurry","glare","isLcd","screenshot","aiGenerated","language","languages","ocrScore","isFront","tiffRejectScore","tiffUpscaled"]}},"classification":{"anyOf":[{"type":"object","properties":{"value":{"type":"string","description":"A document class, or one of the labels the caller named."},"score":{"type":"number","description":"0..1."},"engine":{"type":"string","enum":["rules","claude"]},"scores":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},"description":"The runners-up, best first."}},"required":["value","score","engine","scores"]},{"type":"null"}],"description":"What the classifier decided, when it was asked."},"blueprint":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"description":"Null for a built-in, which has no versions.","type":["number","null"]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"The fields the blueprint defines. Null when the run failed."},"offsets":{"description":"Where each value sits in the text, for a blueprint that asks.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"begin":{"type":"number"},"end":{"type":"number"}},"required":["begin","end"]}},"unmatched":{"description":"Fields where a value was read and did not fit, such as words where a number belongs or a choice off the list. Each is left empty. An empty field not named here was not on the document.","type":"array","items":{"type":"string"}},"error":{"description":"Why the run gave nothing back.","type":["string","null"]}},"required":["name","version","result","error"]},{"type":"null"}],"description":"The blueprint this was read with, and what came out of it."},"tags":{"type":"array","items":{"type":"string"}},"tagRefs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"The same tags with their ids, which a tag route takes."},"recordStatus":{"anyOf":[{"type":"string","enum":["processed","reviewed","archived"]},{"type":"null"}],"description":"Where a read document stands: reviewedAt and archivedAt in one word. Null until it has been read."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."},"setId":{"description":"The upload this came out of: a ZIP, a split PDF or a batch of addresses.","type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"type":"null"}],"description":"Values the workspace custom field rules read out of the text."},"enrichment":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","DONE","FAILED"]},"steps":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"failed":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}}},"required":["status","steps","failed"]},{"type":"null"}],"description":"Work still running after the first answer."},"extraction":{"anyOf":[{"type":"object","properties":{"fields":{"type":"object","properties":{"documentType":{"default":"RECEIPT","$ref":"#/components/schemas/DocumentType"},"merchantName":{"type":["string","null"]},"merchantAddress":{"type":["string","null"]},"merchantPhone":{"type":["string","null"]},"merchantWebsite":{"type":["string","null"]},"merchantTaxId":{"type":["string","null"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"time":{"type":["string","null"]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHF","CLP","CNY","COP","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","UYU","UZS","VES","VND","VUV","WST","XAF","XCD","XCG","XOF","XPF","YER","ZAR","ZMW","ZWG","CUC","HRK","SLL","ZWL","XDR","XSU"]},{"type":"null"}]},"currencyGuessed":{"default":false,"type":"boolean"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxLines":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"ratePct":{"type":["number","null"]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"baseMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"code":{"type":["string","null"]},"totalInclusive":{"type":["boolean","null"]}},"required":["amountMinor"]}},"tipMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"shippingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"paymentType":{"anyOf":[{"$ref":"#/components/schemas/PaymentType"},{"type":"null"}]},"cardBrand":{"type":["string","null"]},"cardLast4":{"type":["string","null"]},"receiptNumber":{"type":["string","null"]},"invoiceNumber":{"type":["string","null"]},"poNumber":{"type":["string","null"]},"lineItems":{"default":[],"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"id":{"type":["string","null"]},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"text":{"type":["string","null"]},"type":{"anyOf":[{"$ref":"#/components/schemas/LineItemType"},{"type":"null"}]},"fullDescription":{"type":["string","null"]},"normalizedDescription":{"type":["string","null"]},"section":{"type":["string","null"]},"reference":{"type":["string","null"]},"upc":{"type":["string","null"]},"hsn":{"type":["string","null"]},"lot":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unitOfMeasure":{"type":["string","null"]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountRatePct":{"type":["number","null"]},"discountPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxRatePct":{"type":["number","null"]},"taxCode":{"type":["string","null"]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"grossTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"netTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"category":{"type":["string","null"]},"customCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"countryOfOrigin":{"type":["string","null"]},"manufacturer":{"type":["string","null"]},"weight":{"type":["string","null"]},"brand":{"type":["string","null"]},"hsaFsaEligible":{"type":["boolean","null"]},"productInfo":{"anyOf":[{"type":"object","properties":{"expandedDescription":{"type":["string","null"]},"brand":{"type":["string","null"]},"categoryPath":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}}},{"type":"null"}]}},"required":["description","amountMinor"]}},"suggestedCategory":{"type":["string","null"]},"documentTitle":{"type":["string","null"]},"documentReferenceNumber":{"type":["string","null"]},"isDocument":{"type":["boolean","null"]},"isTransaction":{"type":["boolean","null"]},"isMoneyIn":{"type":["boolean","null"]},"accountingEntryType":{"anyOf":[{"type":"string","enum":["debit","credit"]},{"type":"null"}]},"vendor":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"vendors":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}}},{"type":"null"}]},"bankBreakdown":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}}},{"type":"null"}]},"billTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"vatNumber":{"type":["string","null"]},"regNumber":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"email":{"type":["string","null"]}}},{"type":"null"}]},"shipTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"insuranceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cashbackMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"roundingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"finalBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"previousBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"totalQuantity":{"type":["number","null"]},"totalWeight":{"type":["string","null"]},"payment":{"anyOf":[{"type":"object","properties":{"cardNumber":{"type":["string","null"]},"displayName":{"type":["string","null"]},"terms":{"type":["string","null"]},"type":{"anyOf":[{"$ref":"#/components/schemas/PaymentMethod"},{"type":"null"}]}}},{"type":"null"}]},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"shipDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"deliveryDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"exchangeRate":{"type":["number","null"]},"countryCode":{"type":["string","null"]},"deliveryNoteNumber":{"type":["string","null"]},"trackingNumber":{"type":["string","null"]},"trackingNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"incoterms":{"type":["string","null"]},"weights":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"licensePlateNumber":{"type":["string","null"]},"vinNumber":{"type":["string","null"]},"guestCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"serverName":{"type":["string","null"]},"storeNumber":{"type":["string","null"]},"vendingPerson":{"type":["string","null"]},"vendingPersonNumber":{"type":["string","null"]},"customerAccountNumber":{"type":["string","null"]},"category":{"type":["string","null"]},"defaultCategory":{"type":["string","null"]},"barcodes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"data":{"type":"string"},"type":{"$ref":"#/components/schemas/BarcodeType"},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"boundingRegion":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]}},"required":["data","type","page"]}},{"type":"null"}]},"paymentLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"source":{"type":"string","enum":["text","hyperlink","qr_code","barcode"]}},"required":["url","source"]}},{"type":"null"}]},"folio":{"anyOf":[{"type":"object","properties":{"arrivalDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"departureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roomNumber":{"type":["string","null"]},"guestName":{"type":["string","null"]},"nights":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"confirmationNumber":{"type":["string","null"]}}},{"type":"null"}]},"enrichedFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"check":{"anyOf":[{"type":"object","properties":{"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountText":{"type":["string","null"]},"amountsAgree":{"type":["boolean","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"checkNumber":{"type":["string","null"]},"checkType":{"anyOf":[{"$ref":"#/components/schemas/CheckType"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"memo":{"type":["string","null"]},"payerName":{"type":["string","null"]},"payerAddress":{"type":["string","null"]},"receiverName":{"type":["string","null"]},"receiverAddress":{"type":["string","null"]},"isSigned":{"type":["boolean","null"]},"endorsement":{"anyOf":[{"type":"object","properties":{"isEndorsed":{"type":["boolean","null"]},"isSigned":{"type":["boolean","null"]},"mobileOrRemoteDeposit":{"anyOf":[{"type":"object","properties":{"checkbox":{"type":["boolean","null"]},"instructions":{"type":["boolean","null"]}}},{"type":"null"}]},"isMobileOrRemoteDepositOnly":{"type":["boolean","null"]}}},{"type":"null"}]},"micr":{"anyOf":[{"type":"object","properties":{"routingNumber":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"serialNumber":{"type":["string","null"]},"raw":{"type":["string","null"]},"branch":{"type":["string","null"]},"institution":{"type":["string","null"]},"transactionCode":{"type":["string","null"]}}},{"type":"null"}]},"fractionalRoutingNumber":{"type":["string","null"]},"routingFromFractional":{"type":["string","null"]},"voidTerms":{"type":["string","null"]}}},{"type":"null"}]},"statement":{"anyOf":[{"type":"object","properties":{"accountHolderName":{"type":["string","null"]},"accountHolderAddress":{"type":["string","null"]},"accountType":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"bankWebsite":{"type":["string","null"]},"bankVatNumber":{"type":["string","null"]},"accountVatNumber":{"type":["string","null"]},"periodStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"periodEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementNumber":{"type":["string","null"]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"minimumDueMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"routingNumber":{"type":["string","null"]},"swift":{"type":["string","null"]},"iban":{"type":["string","null"]},"accounts":{"default":[],"type":"array","items":{"type":"object","properties":{"number":{"type":["string","null"]},"ibanNumber":{"type":["string","null"]},"accountType":{"type":["string","null"]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"summaries":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["name"]}},"transactions":{"default":[],"type":"array","items":{"type":"object","properties":{"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"postedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"vendor":{"type":["string","null"]},"transactionId":{"type":["string","null"]},"debitAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"creditAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cardNumber":{"type":["string","null"]},"text":{"type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"page":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["order"]}}}}},"balancesAgree":{"type":["boolean","null"]}}},{"type":"null"}]},"taxForm":{"anyOf":[{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/TaxFormKind"},"w2":{"anyOf":[{"type":"object","properties":{"employeeSsn":{"type":["string","null"]},"ein":{"type":["string","null"]},"employerName":{"type":["string","null"]},"employerAddress":{"type":["string","null"]},"controlNumber":{"type":["string","null"]},"employeeName":{"type":["string","null"]},"employeeAddress":{"type":["string","null"]},"wagesOtherComps":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"federalIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"allocatedTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"advanceEicPayment":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dependentCareBenefits":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"nonQualifiedPlans":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"box12":{"default":[],"type":"array","items":{"type":"object","properties":{"box":{"type":"string"},"code":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["box","code"]}},"is13a":{"type":["boolean","null"]},"is13b":{"type":["boolean","null"]},"is13c":{"type":["boolean","null"]},"box14Other":{"default":[],"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["label"]}},"stateLines":{"default":[],"type":"array","items":{"type":"object","properties":{"state":{"type":["string","null"]},"employerStateId":{"type":["string","null"]},"stateWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"stateIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localityName":{"type":["string","null"]}}}},"taxYear":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}}},{"type":"null"}]},"w9":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"businessName":{"type":["string","null"]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"individual":{"type":["boolean","null"]},"cCorp":{"type":["boolean","null"]},"sCorp":{"type":["boolean","null"]},"partnership":{"type":["boolean","null"]},"trustEstate":{"type":["boolean","null"]},"llc":{"type":["boolean","null"]},"llcType":{"type":["string","null"]},"other":{"type":["boolean","null"]},"otherDescription":{"type":["string","null"]},"exemptPayeeCode":{"type":["string","null"]},"exemption":{"type":["string","null"]},"ssn":{"type":["string","null"]},"ein":{"type":["string","null"]},"accountNumbers":{"type":["string","null"]},"requester":{"type":["string","null"]},"signature":{"type":["boolean","null"]},"signatureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}}},{"type":"null"}]},"w8BenE":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","boolean","null"]}},{"type":"null"}]}},"required":["kind"]},{"type":"null"}]},"itinerary":{"anyOf":[{"type":"object","properties":{"travelerName":{"type":["string","null"]},"bookingReference":{"type":["string","null"]},"origin":{"type":["string","null"]},"destination":{"type":["string","null"]},"departsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"returnsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"segments":{"default":[],"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["flight","hotel","car","rail","other"]},"carrier":{"type":["string","null"]},"number":{"type":["string","null"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"departsAt":{"type":["string","null"]},"arrivesAt":{"type":["string","null"]},"confirmationNumber":{"type":["string","null"]},"seat":{"type":["string","null"]}},"required":["kind"]}}}},{"type":"null"}]},"fieldConfidence":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fieldBoxes":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"page":{"type":"number"},"box":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4}},"required":["page","box"]}}},"description":"What was read, as the extraction contract types it. fieldConfidence holds per-field confidence, 0..1."},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/IntegrityWarning"},"message":{"type":"string"},"page":{"type":["number","null"]}},"required":["code","message"]},"description":"Integrity findings. A caller without expenses.read_all sees the arithmetic and dates only."}},"required":["fields","confidence","flags","warnings"]},{"type":"null"}]},"fraud":{"anyOf":[{"$ref":"#/components/schemas/DocumentFraud"},{"type":"null"}]},"sealed":{"type":"array","items":{"$ref":"#/components/schemas/SealedValue"},"description":"Bank and tax numbers read from this document, as masks. POST /v1/documents/{id}/reveal opens them."},"updatedAt":{"type":"string"},"extractor":{"description":"What read it: rules, claude, a blueprint, business-card, or none.","type":["string","null"]},"ocrText":{"description":"Everything read off the page. Card, bank and tax numbers are masked.","type":["string","null"]},"pdfUrl":{"description":"The PDF as uploaded, signed for 15 minutes. Null for an image, and for a PDF that prints a number only a reveal hands out.","type":["string","null"]},"meta":{"$ref":"#/components/schemas/DocumentMeta"},"reviewedAt":{"description":"A person checked what was read.","type":["string","null"]},"approvedAt":{"description":"A developer's own approved flag. An expense's approval is a different thing.","type":["string","null"]},"reading":{"description":"Null when nothing has been read yet.","anyOf":[{"type":"object","properties":{"lines":{"description":"With bounding_boxes: every line read, with where it is.","type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"confidence":{"type":"number"},"box":{"description":"[x, y, width, height] in pixels of the page.","type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4},"quad":{"description":"The four corners as x, y pairs, for a line read at an angle.","type":"array","items":{"type":"number"}},"page":{"type":"number"}},"required":["text","confidence","page"]}},"fieldDetail":{"description":"With confidence_details: where each field was read from and how sure the read was.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},{"type":"null"}]},"detailed":{"description":"With detailed: the reading with each field wrapped as value, score, ocrScore, rotation, boundingBox, boundingRegion and enriched."},"lineItemsWithScores":{"description":"With with_scores: the same lines, with a value and its confidence on every sub-field.","type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"taxLinesWithScores":{"description":"With with_scores: the same tax lines, with a value and its confidence on every sub-field.","type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["id","type","source","status","originalFilename","mimeType","sizeBytes","pageCount","externalId","folderId","expenseId","mailInBatchId","title","notes","latitude","longitude","locationAccuracyM","duplicateOfId","processingError","processingErrorCode","verification","capturedAt","processedAt","viewedAt","archivedAt","createdAt","uploadedBy","pages","classification","blueprint","tags","tagRefs","recordStatus","duplicates","setId","customFields","enrichment","extraction","fraud","sealed","updatedAt","extractor","ocrText","pdfUrl","meta","reviewedAt","approvedAt"]},"DocumentTagList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DocumentTag"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ExpenseLine":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"type":["number","null"]},"amountMinor":{"type":"number"},"taxMinor":{"type":["number","null"]},"categoryId":{"type":["string","null"]}},"required":["id","position","description","sku","quantity","unitPriceMinor","amountMinor","taxMinor","categoryId"]},"ExpenseLinePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseLine"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ExpenseTaxLine":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"name":{"type":["string","null"]},"code":{"type":["string","null"]},"ratePct":{"type":["number","null"]},"baseMinor":{"type":["number","null"]},"amountMinor":{"type":"number"}},"required":["id","position","name","code","ratePct","baseMinor","amountMinor"]},"ExpenseTaxLinePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseTaxLine"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"WorkspaceClosed":{"type":"object","properties":{"status":{"type":"string","const":"closed"},"purgeAfter":{"type":"string","description":"Records are erased after this moment."},"storeSubscriptions":{"type":"array","items":{"type":"object","properties":{"workspaceId":{"type":"string"},"workspaceName":{"type":"string"},"store":{"type":"string","enum":["APP_STORE","PLAY_STORE"]}},"required":["workspaceId","workspaceName","store"]},"description":"Non-empty when a store goes on billing until someone cancels there."}},"required":["status","purgeAfter","storeSubscriptions"]},"ReferenceCurrencyPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"minorDigits":{"type":"number","description":"Decimal places in the minor unit: 2 for USD, 0 for JPY."}},"required":["code","name","minorDigits"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ReferenceCountryPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string","description":"The currency its receipts print."}},"required":["code","name","currency"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ReferenceLocalePage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ReferenceSystemCategoryPage":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"Stays when a workspace renames its copy."},"name":{"type":"string"},"glCode":{"type":["string","null"]},"taxLine":{"type":["string","null"]},"deductiblePct":{"type":"number"}},"required":["key","name","glCode","taxLine","deductiblePct"]}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"BulkReimbursed":{"type":"object","properties":{"reimbursed":{"type":"array","items":{"type":"string"}},"skipped":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":["string","null"]},"code":{"type":"string"},"message":{"type":"string"}},"required":["id","reference","code","message"]},"description":"Not in a state to mark: not approved yet, already paid, in a batch, or nothing on it is reimbursable. Left as it was."},"failed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":["string","null"]},"code":{"type":"string"},"message":{"type":"string"}},"required":["id","reference","code","message"]},"description":"Not found, or not the caller's to mark."}},"required":["reimbursed","skipped","failed"]},"DocumentList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Document"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]},"offset":{"description":"Where this page starts, when paging by offset or page.","type":"number"},"nextOffset":{"description":"Send this as `offset` for the next page. Null on the last one.","type":["number","null"]},"page":{"description":"When paging by page number.","type":"number"},"pageSize":{"type":"number"},"totalCount":{"description":"With track_total_results: every document the caller can reach.","type":"number"},"filteredCount":{"description":"With track_total_results: what the filters leave of those.","type":"number"}},"required":["data","nextCursor"]},"ProvisionResult":{"type":"object","properties":{"dryRun":{"type":"boolean"},"added":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"invited":{"type":"boolean"}},"required":["email","invited"]}},"updated":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"fields":{"type":"array","items":{"type":"string"}}},"required":["email","fields"]}},"removed":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"}},"required":["email"]}},"skipped":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"reason":{"type":"string"}},"required":["email","reason"]}}},"required":["dryRun","added","updated","removed","skipped"]},"AutomationApply":{"type":"object","properties":{"matched":{"type":"number"},"updated":{"type":"number"}},"required":["matched","updated"]},"AutomationPreview":{"type":"object","properties":{"matched":{"type":"number","description":"Expenses the conditions match, voided ones aside."},"applicable":{"type":"number","description":"Of those, the ones still unsubmitted, which is what applying the rule changes."},"sample":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"currency":{"type":"string"},"amountMinor":{"type":"number"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","currency","amountMinor","status"]}},"aiSkipped":{"type":"boolean","description":"A question for Claude was left out of this count: it is asked when a document is read, not here."}},"required":["matched","applicable","sample","aiSkipped"]},"AutomationRule":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"position":{"type":"number"},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","enum":["merchantName","description","amountMinor","currency","cardLast4","paymentType","categoryId","merchantType","date","notes","invoiceNumber","ocrText","subtotalMinor","taxMinor","tipMinor","confidence","billable","reimbursable","documentType","source","tags","flags","lineItems.description","lineItems.sku","lineItems.amountMinor","lineItems.quantity","ai"]},"op":{"type":"string","enum":["equals","contains","contains_case","starts_with","gte","lte","not_equals","not_contains","gt","lt","is_empty","is_not_empty","matches_regex","not_matches_regex","between","within_days_before_today","within_days_after_date","within_days_before_date","ask"]},"value":{"anyOf":[{"type":"string","minLength":1,"maxLength":2000},{"type":"number"},{"type":"boolean"},{"type":"object","properties":{"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["from","to"],"additionalProperties":false},{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"days":{"type":"integer","minimum":0,"maximum":3650}},"required":["date","days"],"additionalProperties":false}]},"fallback":{"type":"string","enum":["no_match","match"]}},"required":["field","op"]}},"actions":{"type":"object","properties":{"categoryId":{"type":"string","minLength":1},"projectId":{"type":"string","minLength":1},"clientId":{"type":"string","minLength":1},"tagIds":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"$ref":"#/components/schemas/PaymentType"},"description":{"type":"string","minLength":1,"maxLength":1000},"merchantName":{"type":"string","minLength":1,"maxLength":255},"taxBasisPoints":{"type":"integer","minimum":0,"maximum":10000},"vendorId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"postToBooks":{"type":"boolean","const":true},"clear":{"maxItems":3,"type":"array","items":{"type":"string","enum":["categoryId","tagIds","taxMinor"]}},"reportId":{"type":"string","minLength":1},"autoApprove":{"type":"boolean","const":true},"reject":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"flagForReview":{"type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":500}},"required":["reason"]},"setStatus":{"type":"string","enum":["NEEDS_REVIEW","READY"]},"group":{"type":"object","properties":{"report":{"type":"string","minLength":1,"maxLength":200}},"required":["report"]},"setCustomFields":{"type":"object","propertyNames":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"additionalProperties":{"anyOf":[{"type":"string","minLength":1,"maxLength":500},{"type":"number"},{"type":"boolean"}]}},"extract":{"maxItems":10,"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"regex"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"pattern":{"type":"string","minLength":1,"maxLength":200}},"required":["kind","field","pattern"]},{"type":"object","properties":{"kind":{"type":"string","const":"key_value"},"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":100}},"required":["kind","field","label"]}]}},"llmExtract":{"maxItems":3,"type":"array","items":{"type":"object","properties":{"field":{"type":"string","pattern":"^[a-z][a-z0-9_]{0,39}$"},"prompt":{"type":"string","minLength":1,"maxLength":2000},"examples":{"default":[],"maxItems":3,"type":"array","items":{"type":"object","properties":{"input":{"type":"string","minLength":1,"maxLength":500},"output":{"type":"string","minLength":1,"maxLength":200}},"required":["input","output"]}},"fallback":{"oneOf":[{"type":"object","properties":{"action":{"type":"string","const":"none"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"flag_for_review"}},"required":["action"]},{"type":"object","properties":{"action":{"type":"string","const":"set_value"},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["action","value"]}]}},"required":["field","prompt","fallback"]}}}},"matchCount":{"type":"number"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","enabled","position","conditions","actions","matchCount","createdAt","updatedAt"]},"AutomationRuleOrder":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AutomationRule"}}},"required":["data"]},"AutomationRuleList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AutomationRule"}},"aiAvailable":{"type":"boolean","description":"Whether a question for Claude can be asked right now. When it cannot, each rule that needs one takes its fallback."}},"required":["data","aiAvailable"]},"Billing":{"type":"object","properties":{"plan":{"anyOf":[{"$ref":"#/components/schemas/PlanKey"},{"type":"null"}]},"status":{"type":"string","enum":["TRIALING","ACTIVE","PAST_DUE","EXPIRED","NONE"]},"source":{"anyOf":[{"type":"string","enum":["STRIPE","APP_STORE","PLAY_STORE","TRIAL","COMP"]},{"type":"null"}]},"active":{"type":"boolean"},"interval":{"anyOf":[{"$ref":"#/components/schemas/BillingInterval"},{"type":"null"}]},"seats":{"type":"number","description":"Seats the workspace holds."},"seatsUsed":{"type":"number","description":"Members now plus open invitations, which hold a seat each. Above `seats` after a downgrade."},"seatsIncluded":{"type":["number","null"]},"maxSeats":{"description":"Null is unlimited, or no plan.","type":["number","null"]},"trialEndsAt":{"type":["string","null"]},"currentPeriodEnd":{"type":["string","null"]},"cancelAtPeriodEnd":{"type":"boolean"},"storeManaged":{"type":"boolean","description":"A live App Store or Google Play subscription owns this workspace, so the web cannot sell to it."},"store":{"anyOf":[{"type":"string","enum":["APP_STORE","PLAY_STORE"]},{"type":"null"}]},"hasStripeSubscription":{"type":"boolean"},"canOpenPortal":{"type":"boolean"},"usage":{"type":"array","items":{"type":"object","properties":{"metric":{"type":"string","enum":["scans","api_documents"]},"used":{"type":"number"},"limit":{"type":"number"}},"required":["metric","used","limit"]},"description":"The plan's counters for this month."},"stripeConfigured":{"type":"boolean"},"cashsdkConfigured":{"type":"boolean"}},"required":["plan","status","source","active","interval","seats","seatsUsed","seatsIncluded","maxSeats","trialEndsAt","currentPeriodEnd","cancelAtPeriodEnd","storeManaged","store","hasStripeSubscription","canOpenPortal","usage","stripeConfigured","cashsdkConfigured"]},"BulkMemberResult":{"type":"object","properties":{"succeeded":{"type":"array","items":{"type":"string"}},"failed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"message":{"type":"string"}},"required":["id","message"]},"description":"Members the rules refused. They stay as they were, and the rest still change."}},"required":["succeeded","failed"]},"CardStatements":{"type":"array","items":{"$ref":"#/components/schemas/CardStatement"}},"Integration":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/IntegrationProvider"},"slug":{"type":"string"},"name":{"type":"string"},"group":{"type":"string","enum":["ACCOUNTING","PAYROLL","HR","CAPTURE","STORAGE","CHAT","AUTOMATION"]},"availability":{"type":"string","enum":["NOT_CONFIGURED","AVAILABLE","CONNECTED","NEEDS_ATTENTION","EXPORT_AVAILABLE","NOT_CONNECTED"]},"label":{"type":"string","description":"The short status, as printed on the card."},"description":{"type":"string"},"export":{"anyOf":[{"type":"object","properties":{"format":{"$ref":"#/components/schemas/ExportFormat"},"label":{"type":"string"},"payroll":{"type":"boolean"}},"required":["format","label"]},{"type":"null"}],"description":"The file that works today, with this provider or without it."},"organisationName":{"type":["string","null"]},"organisationChoices":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"lastSyncedAt":{"type":["string","null"]},"lastError":{"type":["string","null"]},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"href":{"type":"string"}},"required":["label","href"]}},"customerApp":{"type":"boolean"},"blockedBy":{"type":"string"}},"required":["provider","slug","name","group","availability","label","description","export","organisationName","organisationChoices","lastSyncedAt","lastError","links"]},"IntegrationHealth":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/IntegrationProvider"},"slug":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["CONNECTED","NEEDS_ATTENTION","DISCONNECTED"]},"organisationName":{"type":["string","null"]},"synced":{"type":"number"},"pending":{"type":"number"},"failed":{"type":"number"},"skipped":{"type":"number"},"voided":{"type":"number"},"waiting":{"type":"number","description":"Approved expenses with no record yet."},"lastSyncedAt":{"type":["string","null"]},"tokenExpiresAt":{"type":["string","null"]},"refreshTokenExpiresAt":{"type":["string","null"]},"endsOnDate":{"type":"boolean"},"pausedUntil":{"type":["string","null"]},"pulledAt":{"type":["string","null"]},"postingPaused":{"anyOf":[{"type":"object","properties":{"since":{"type":"string"},"code":{"type":"string"},"message":{"type":"string"}},"required":["since","code","message"]},{"type":"null"}]}},"required":["provider","slug","name","status","organisationName","synced","pending","failed","skipped","voided","waiting","lastSyncedAt","tokenExpiresAt","refreshTokenExpiresAt","pausedUntil","pulledAt"]},"IntegrationList":{"type":"array","items":{"$ref":"#/components/schemas/Integration"}},"Invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":["string","null"]},"role":{"$ref":"#/components/schemas/MemberRole"},"status":{"$ref":"#/components/schemas/InvitationStatus"},"invitedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"expiresAt":{"type":"string"},"acceptedAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","email","name","role","status","invitedBy","expiresAt","acceptedAt","revokedAt","createdAt"]},"InvitationPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Invitation"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"InvitationSent":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":["string","null"]},"role":{"$ref":"#/components/schemas/MemberRole"},"status":{"$ref":"#/components/schemas/InvitationStatus"},"invitedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"expiresAt":{"type":"string"},"acceptedAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"acceptUrl":{"type":"string","description":"The link the email carries. It works only for someone signed in with this address."}},"required":["id","email","name","role","status","invitedBy","expiresAt","acceptedAt","revokedAt","createdAt","acceptUrl"]},"MailInAllowance":{"type":"object","properties":{"period":{"type":"string","description":"YYYY-MM."},"limit":{"type":"number","description":"Documents a month on this plan."},"used":{"type":"number","description":"Held by this month's batches. It can pass the limit: paper that has arrived is scanned regardless."},"remaining":{"type":"number"},"included":{"type":"boolean","description":"False when the plan does not include mail-in at all."},"available":{"type":"boolean","description":"False until there is a mailroom to send paper to, whatever the plan says."},"mailroomAddress":{"description":"Where own-packaging paper goes. Null until a mailroom has one.","type":["string","null"]},"envelopes":{"$ref":"#/components/schemas/MailInEnvelopeAllowance"}},"required":["period","limit","used","remaining","included","available","mailroomAddress","envelopes"]},"MailInSettings":{"type":"object","properties":{"address":{"anyOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"type":"string","minLength":1,"maxLength":120},"region":{"type":"string","minLength":1,"maxLength":120},"postalCode":{"type":"string","minLength":1,"maxLength":20},"country":{"default":"US","type":"string","pattern":"^[A-Z]{2}$"}},"required":["name","line1","city","region","postalCode"]},{"type":"null"}]},"updatedAt":{"type":["string","null"]}},"required":["address","updatedAt"]},"MailInBatch":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string","description":"Printed on the packing slip and on the cover sheet."},"workspaceReference":{"type":"string"},"status":{"$ref":"#/components/schemas/MailInStatus"},"envelopes":{"type":"number"},"expectedDocuments":{"type":"number"},"documentCount":{"type":"number"},"afterScan":{"$ref":"#/components/schemas/MailInDisposal"},"shippingAddress":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"type":"string","minLength":1,"maxLength":120},"region":{"type":"string","minLength":1,"maxLength":120},"postalCode":{"type":"string","minLength":1,"maxLength":20},"country":{"default":"US","type":"string","pattern":"^[A-Z]{2}$"}},"required":["name","line1","city","region","postalCode"]},"folderId":{"type":["string","null"]},"trackingNumber":{"type":["string","null"]},"notes":{"type":["string","null"]},"requestedById":{"type":"string"},"requestedByName":{"description":"Who this paper belongs to, as printed on the slip and the cover sheet.","type":["string","null"]},"requestedByEmail":{"type":["string","null"]},"envelopeSentAt":{"type":["string","null"]},"receivedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","reference","workspaceReference","status","envelopes","expectedDocuments","documentCount","afterScan","shippingAddress","folderId","trackingNumber","notes","requestedById","requestedByName","requestedByEmail","envelopeSentAt","receivedAt","completedAt","createdAt","updatedAt"]},"MailInBatchPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MailInBatch"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"MailInRequested":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string","description":"Printed on the packing slip and on the cover sheet."},"workspaceReference":{"type":"string"},"status":{"$ref":"#/components/schemas/MailInStatus"},"envelopes":{"type":"number"},"expectedDocuments":{"type":"number"},"documentCount":{"type":"number"},"afterScan":{"$ref":"#/components/schemas/MailInDisposal"},"shippingAddress":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"company":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"line1":{"type":"string","minLength":1,"maxLength":200},"line2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"type":"string","minLength":1,"maxLength":120},"region":{"type":"string","minLength":1,"maxLength":120},"postalCode":{"type":"string","minLength":1,"maxLength":20},"country":{"default":"US","type":"string","pattern":"^[A-Z]{2}$"}},"required":["name","line1","city","region","postalCode"]},"folderId":{"type":["string","null"]},"trackingNumber":{"type":["string","null"]},"notes":{"type":["string","null"]},"requestedById":{"type":"string"},"requestedByName":{"description":"Who this paper belongs to, as printed on the slip and the cover sheet.","type":["string","null"]},"requestedByEmail":{"type":["string","null"]},"envelopeSentAt":{"type":["string","null"]},"receivedAt":{"type":["string","null"]},"completedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"envelopeAllowance":{"$ref":"#/components/schemas/MailInEnvelopeAllowance"}},"required":["id","reference","workspaceReference","status","envelopes","expectedDocuments","documentCount","afterScan","shippingAddress","folderId","trackingNumber","notes","requestedById","requestedByName","requestedByEmail","envelopeSentAt","receivedAt","completedAt","createdAt","updatedAt","envelopeAllowance"]},"MailInDocumentPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MailInDocument"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Member":{"type":"object","properties":{"id":{"type":"string","description":"The membership: the id PATCH and DELETE /v1/members/:id take."},"userId":{"type":"string"},"email":{"type":"string"},"name":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"pronouns":{"type":["string","null"]},"personStatus":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"clearsAt":{"type":["string","null"]}},"required":["text","clearsAt"]},{"type":"null"}],"description":"The note they set beside their name, until it clears. `status` is their membership."},"role":{"$ref":"#/components/schemas/MemberRole"},"status":{"$ref":"#/components/schemas/MemberStatus"},"developer":{"type":"boolean","description":"Whether this person can reach API keys and webhooks: always for an owner, and for an admin only with the grant. False unless the caller has members.manage."},"managerId":{"description":"The manager's user id.","type":["string","null"]},"managerName":{"type":["string","null"]},"title":{"type":["string","null"]},"department":{"type":["string","null"]},"employeeId":{"description":"Null unless the caller has members.manage.","type":["string","null"]},"approvalLimitMinor":{"description":"Null unless the caller has members.manage.","type":["number","null"]},"overLimitApproverId":{"description":"Null unless the caller has members.manage.","type":["string","null"]},"forwardToId":{"description":"Null unless the caller has members.manage.","type":["string","null"]},"workerStatus":{"description":"Null unless the caller has members.manage.","type":["string","null"]},"defaultTags":{"type":"array","items":{"type":"string"},"description":"Empty unless the caller has members.manage."},"customField1":{"type":["string","null"]},"customField2":{"type":["string","null"]},"payrollCode":{"description":"Goes out with payroll files. Null unless the caller manages members.","type":["string","null"]},"legalEntity":{"description":"The company the person is employed by. Null unless the caller manages members.","type":["string","null"]},"tier":{"description":"Their travel tier. Null unless the caller manages members.","type":["string","null"]},"officeLocation":{"description":"The office they work from. Null unless the caller manages members.","type":["string","null"]},"costCenter":{"description":"Where their costs are charged. Null unless the caller manages members.","type":["string","null"]},"accountingCode":{"description":"Their code in the books. Null unless the caller manages members.","type":["string","null"]},"workerType":{"description":"Employee, contractor or the like. Null unless the caller manages members.","type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","userId","email","name","photoUrl","pronouns","personStatus","role","status","developer","managerId","managerName","title","department","employeeId","approvalLimitMinor","overLimitApproverId","forwardToId","workerStatus","defaultTags","customField1","customField2","payrollCode","legalEntity","tier","officeLocation","costCenter","accountingCode","workerType","createdAt"]},"MemberPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Member"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"PaymentAccount":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"$ref":"#/components/schemas/PaymentAccountKind"},"brand":{"type":["string","null"]},"last4":{"type":["string","null"]},"isCompany":{"type":"boolean"},"feedSource":{"$ref":"#/components/schemas/FeedSource"},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},{"type":"null"}]},"institutionName":{"type":["string","null"]},"archived":{"type":"boolean"},"transactionCount":{"type":"number"},"unmatchedCount":{"type":"number"},"lastPostedDate":{"type":["string","null"]},"lastImportedAt":{"description":"When a line last arrived, from a file or the bank.","type":["string","null"]},"transactionStartDate":{"type":["string","null"]},"statementCloseDay":{"type":["number","null"]},"liability":{"$ref":"#/components/schemas/CardLiability"},"reimbursable":{"type":["boolean","null"]},"allowDeletingTransactions":{"type":"boolean"},"glAccount":{"type":["string","null"]},"createExpenses":{"type":"boolean"},"assigneeEmail":{"description":"Invited and not yet in: the card is theirs when they join.","type":["string","null"]},"balance":{"anyOf":[{"type":"object","properties":{"currentMinor":{"type":["number","null"]},"limitMinor":{"type":["number","null"]},"remainingMinor":{"type":["number","null"]},"currency":{"type":"string"},"asOf":{"type":"string"}},"required":["currentMinor","limitMinor","remainingMinor","currency","asOf"]},{"type":"null"}],"description":"What the bank last reported, when it reports these at all."},"createdAt":{"type":"string"}},"required":["id","name","kind","brand","last4","isCompany","feedSource","owner","institutionName","archived","transactionCount","unmatchedCount","lastPostedDate","lastImportedAt","transactionStartDate","statementCloseDay","liability","reimbursable","allowDeletingTransactions","glAccount","createExpenses","assigneeEmail","balance","createdAt"]},"PaymentAccountPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentAccount"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Reconciliation":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"currency":{"type":"string","description":"What every figure here is in. Ask for another with currency."},"currencies":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"count":{"type":"number"},"netMinor":{"type":"number"}},"required":["currency","count","netMinor"]},"description":"Every currency posted in these dates, each with its own count and net."},"importedMinor":{"type":"number","description":"What to hold against the card statement."},"importedCount":{"type":"number"},"approvedMinor":{"type":"number","description":"What to hold against the liability account."},"approvedCount":{"type":"number"},"unapprovedMinor":{"type":"number","description":"What is left to accrue at month end, by where it is stuck."},"unapprovedCount":{"type":"number"},"pendingMinor":{"type":"number","description":"Charges the bank has not posted, which are on no statement yet."},"buckets":{"type":"object","properties":{"unreported":{"type":"object","properties":{"count":{"type":"number"},"amountMinor":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"transactionId":{"type":"string"},"postedDate":{"type":"string"},"description":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},{"type":"null"}]},"ownerId":{"type":["string","null"]}},"required":["transactionId","postedDate","description","amountMinor","currency","account","expense","ownerId"]}}},"required":["count","amountMinor","rows"]},"draft":{"type":"object","properties":{"count":{"type":"number"},"amountMinor":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"transactionId":{"type":"string"},"postedDate":{"type":"string"},"description":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},{"type":"null"}]},"ownerId":{"type":["string","null"]}},"required":["transactionId","postedDate","description","amountMinor","currency","account","expense","ownerId"]}}},"required":["count","amountMinor","rows"]},"outstanding":{"type":"object","properties":{"count":{"type":"number"},"amountMinor":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"transactionId":{"type":"string"},"postedDate":{"type":"string"},"description":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},{"type":"null"}]},"ownerId":{"type":["string","null"]}},"required":["transactionId","postedDate","description","amountMinor","currency","account","expense","ownerId"]}}},"required":["count","amountMinor","rows"]},"deleted":{"type":"object","properties":{"count":{"type":"number"},"amountMinor":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"transactionId":{"type":"string"},"postedDate":{"type":"string"},"description":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},{"type":"null"}]},"ownerId":{"type":["string","null"]}},"required":["transactionId","postedDate","description","amountMinor","currency","account","expense","ownerId"]}}},"required":["count","amountMinor","rows"]},"noExpense":{"type":"object","properties":{"count":{"type":"number"},"amountMinor":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"transactionId":{"type":"string"},"postedDate":{"type":"string"},"description":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},{"type":"null"}]},"ownerId":{"type":["string","null"]}},"required":["transactionId","postedDate","description","amountMinor","currency","account","expense","ownerId"]}}},"required":["count","amountMinor","rows"]},"ignored":{"type":"object","properties":{"count":{"type":"number"},"amountMinor":{"type":"number"},"rows":{"type":"array","items":{"type":"object","properties":{"transactionId":{"type":"string"},"postedDate":{"type":"string"},"description":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},{"type":"null"}]},"ownerId":{"type":["string","null"]}},"required":["transactionId","postedDate","description","amountMinor","currency","account","expense","ownerId"]}}},"required":["count","amountMinor","rows"]}},"required":["unreported","draft","outstanding","deleted","noExpense","ignored"]},"cards":{"type":"array","items":{"type":"object","properties":{"account":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"count":{"type":"number"},"importedMinor":{"type":"number"},"unapprovedMinor":{"type":"number"},"duplicates":{"type":"array","items":{"type":"object","properties":{"postedDate":{"type":"string"},"amountMinor":{"type":"number"},"description":{"type":"string"},"count":{"type":"number"}},"required":["postedDate","amountMinor","description","count"]}}},"required":["account","count","importedMinor","unapprovedMinor","duplicates"]}}},"required":["from","to","currency","currencies","importedMinor","importedCount","approvedMinor","approvedCount","unapprovedMinor","unapprovedCount","pendingMinor","buckets","cards"]},"ReportField":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/ReportFieldType"},"options":{"type":"array","items":{"type":"string"}},"formula":{"type":["string","null"]},"required":{"type":"boolean"},"enabled":{"type":"boolean"},"position":{"type":"number"},"disabledOptions":{"description":"List values turned off: kept on reports that hold them, and not offered for new ones.","type":"array","items":{"type":"string"}},"imported":{"description":"Came from the connected books, so it cannot be deleted and its values only turn on and off.","type":"boolean"}},"required":["id","name","type","options","formula","required","enabled","position"]},"ReportFieldList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReportField"}}},"required":["data"]},"ReportFieldsOff":{"type":"object","properties":{"deleted":{"type":"number","description":"Fields removed. Lists take work to build, so they are kept."},"disabled":{"type":"number","description":"Lists turned off and kept."}},"required":["deleted","disabled"]},"SeatUsage":{"type":"object","properties":{"active":{"type":"number"},"invited":{"type":"number","description":"Open invitations hold a seat until they are accepted, revoked or expire."},"included":{"type":["number","null"]},"paid":{"description":"Seats the workspace holds, which is what stops an invitation. Null with no plan.","type":["number","null"]},"max":{"description":"The most seats this plan can hold. Null is unlimited.","type":["number","null"]},"full":{"anyOf":[{"type":"object","properties":{"metric":{"type":"string","const":"seats"},"limit":{"type":"number"},"used":{"type":"number"},"addSeats":{"anyOf":[{"type":"object","properties":{"seats":{"type":"number"},"added":{"type":"number"},"priceMinor":{"type":"number"},"interval":{"$ref":"#/components/schemas/BillingInterval"}},"required":["seats","added","priceMinor","interval"]},{"type":"null"}]},"askName":{"type":["string","null"]},"appMessage":{"type":"string","description":"The refusal with no price and no way to buy in it, which an app in a store can show as written."},"message":{"type":"string"}},"required":["metric","limit","used","addSeats","askName","appMessage","message"]},{"type":"null"}],"description":"Set once every seat is taken or invited, with what to do about it."}},"required":["active","invited","included","paid","max","full"]},"SyncRecordPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SyncRecord"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Transaction":{"type":"object","properties":{"id":{"type":"string"},"paymentAccount":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]}},"required":["id","name","last4"]},"postedDate":{"type":"string"},"amountMinor":{"type":"number","description":"Positive is money spent. Negative is a refund or a payment to the card."},"currency":{"type":"string"},"description":{"type":"string"},"merchantName":{"type":["string","null"]},"state":{"$ref":"#/components/schemas/TransactionState"},"matchScore":{"type":["number","null"]},"missingReceipt":{"type":"boolean","description":"Older than three days with no expense: a receipt is owed."},"expense":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},{"type":"null"}]},"suggestions":{"type":"array","items":{"type":"object","properties":{"expense":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"status":{"type":"string"}},"required":["id","reference","merchantName","date","amountMinor","currency","status"]},"score":{"type":"number"},"amountGapMinor":{"type":"number"},"dayGap":{"type":"number"}},"required":["expense","score","amountGapMinor","dayGap"]}}},"required":["id","paymentAccount","postedDate","amountMinor","currency","description","merchantName","state","matchScore","missingReceipt","expense","suggestions"]},"TransactionPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"TransactionSummary":{"type":"object","properties":{"currency":{"type":"string","description":"What every figure here is in: the one asked for with currency, or the workspace currency when it has lines, or the commonest."},"currencies":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"count":{"type":"number"},"netMinor":{"type":"number"}},"required":["currency","count","netMinor"]},"description":"Every currency these lines are in, each with its own count and net."},"count":{"type":"number"},"spentMinor":{"type":"number"},"creditedMinor":{"type":"number"},"missingReceipts":{"type":"number"},"byState":{"type":"array","items":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/TransactionState"},"count":{"type":"number"},"amountMinor":{"type":"number"}},"required":["state","count","amountMinor"]}}},"required":["currency","currencies","count","spentMinor","creditedMinor","missingReceipts","byState"]},"Workspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["PERSONAL","TEAM"]},"baseCurrency":{"type":"string"},"role":{"$ref":"#/components/schemas/MemberRole"},"country":{"type":"string"},"timezone":{"type":"string"},"fiscalYearStartMonth":{"type":"number"},"distanceUnit":{"type":"string"},"claimedDomain":{"type":["string","null"]},"requireMfa":{"type":"boolean"},"retentionDays":{"description":"Documents are deleted this many days after they are read. Null keeps them until someone deletes them.","type":["number","null"]},"callLogRetentionDays":{"description":"Days the API call log is kept. Null is the default of 365.","type":["number","null"]},"preferences":{"type":"object","properties":{"locale":{"description":"How this workspace's findings write money. Null is the person's own.","type":["string","null"]},"showDefaultCategories":{"type":"boolean","description":"False takes the built-in categories out of everyone's list but a manager's, and out of what reading a document suggests."},"shredDocuments":{"type":"boolean","description":"Paper from a mail-in batch is shredded after scanning, unless the batch says otherwise."},"reimbursableTracking":{"type":"boolean","description":"False takes reimbursing out of the workspace: nothing new is flagged."},"calculateMissingTax":{"type":"boolean","description":"Works out a missing tax on a captured document at vatBasisPoints, and says so on the expense."},"dateFormat":{"description":"How dates read across the app. The API always sends YYYY-MM-DD.","$ref":"#/components/schemas/DateFormat"},"vatBasisPoints":{"description":"VAT within the total on a typed expense that gives no tax, in hundredths of a percent. 2000 is 20%.","type":["number","null"]}},"required":["locale","showDefaultCategories","shredDocuments","reimbursableTracking","calculateMissingTax","dateFormat","vatBasisPoints"]},"permissions":{"readOnly":true,"description":"What this caller may do here, from the role of the person the key belongs to.","type":"array","items":{"type":"string","enum":["expenses.read_all","expenses.write_all","reports.read_all","reports.approve","reimbursements.manage","members.manage","settings.manage","policies.manage","billing.manage","integrations.manage","exports.all","developer.manage","audit.read","documents.reveal","cards.manage","security.manage","workspace.delete"]}},"entitlement":{"type":"object","properties":{"plan":{"anyOf":[{"$ref":"#/components/schemas/PlanKey"},{"type":"null"}]},"lastPlan":{"description":"With no plan in force, the one the workspace held last. What it could read stays readable.","anyOf":[{"$ref":"#/components/schemas/PlanKey"},{"type":"null"}]},"status":{"type":"string","enum":["TRIALING","ACTIVE","PAST_DUE","EXPIRED","NONE"]},"source":{"anyOf":[{"type":"string","enum":["STRIPE","APP_STORE","PLAY_STORE","TRIAL","COMP"]},{"type":"null"}]},"active":{"type":"boolean","description":"Capture and edits stop when this is false. Reading and exporting never do."},"trialEndsAt":{"type":["string","null"]},"currentPeriodEnd":{"type":["string","null"]},"cancelAtPeriodEnd":{"type":"boolean"},"interval":{"anyOf":[{"$ref":"#/components/schemas/BillingInterval"},{"type":"null"}]},"seats":{"type":"number"},"features":{"readOnly":true,"type":"array","items":{"type":"string","enum":["receipt_capture","email_capture","mileage","expense_reports","tax_reports","standard_exports","multi_currency","business_cards","mail_in","automation_rules","card_feeds","accounting_sync","approvals","policies","reimbursements","custom_fields","per_diem","human_verification","developer_api","multi_level_approvals","sso","audit_log","scheduled_reports"]}},"limits":{"anyOf":[{"type":"object","properties":{"scansPerMonth":{"type":"number"},"seatsIncluded":{"type":"number"},"maxSeats":{"type":["number","null"]},"apiDocumentsPerMonth":{"type":"number"},"mailInDocumentsPerMonth":{"type":"number"}},"required":["scansPerMonth","seatsIncluded","maxSeats","apiDocumentsPerMonth","mailInDocumentsPerMonth"]},{"type":"null"}]}},"required":["plan","status","source","active","trialEndsAt","currentPeriodEnd","cancelAtPeriodEnd","interval","seats","features","limits"]},"services":{"type":"object","properties":{"mailIn":{"type":"boolean"},"humanVerification":{"type":"boolean"}},"required":["mailIn","humanVerification"]},"usage":{"type":"object","propertyNames":{"type":"string","enum":["scans","api_documents"]},"additionalProperties":{"type":"number"},"required":["scans","api_documents"]},"memberCount":{"type":"number"},"sandboxOfId":{"description":"The workspace this is the sandbox of. Null for a live workspace.","type":["string","null"]},"readingModel":{"description":"What reads this workspace's documents.","$ref":"#/components/schemas/ReadingModel"},"actingFor":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"access":{"$ref":"#/components/schemas/DelegationAccess"}},"required":["userId","name","access"]},{"type":"null"}]}},"required":["id","name","kind","baseCurrency","role","country","timezone","fiscalYearStartMonth","distanceUnit","claimedDomain","requireMfa","retentionDays","callLogRetentionDays","preferences","permissions","entitlement","services","usage","memberCount","sandboxOfId","readingModel"]},"WorkspaceCounts":{"type":"object","properties":{"needsReview":{"type":"number"},"processing":{"type":"number"},"pendingApprovals":{"type":"number"},"holdsApprovals":{"type":"boolean"},"unmatchedTransactions":{"type":"number"},"unreadNotifications":{"type":"number"}},"required":["needsReview","processing","pendingApprovals","holdsApprovals","unmatchedTransactions","unreadNotifications"]},"WorkspaceCreated":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["PERSONAL","TEAM"]},"baseCurrency":{"type":"string"},"role":{"$ref":"#/components/schemas/MemberRole"},"entitlement":{"type":"object","properties":{"plan":{"anyOf":[{"$ref":"#/components/schemas/PlanKey"},{"type":"null"}],"description":"What the workspace holds now: what the trial of its owner has left, or nothing. Naming a plan does not buy it."},"status":{"type":"string","enum":["TRIALING","ACTIVE","PAST_DUE","EXPIRED","NONE"]},"active":{"type":"boolean"},"trialEndsAt":{"type":["string","null"]}},"required":["plan","status","active","trialEndsAt"]},"checkout":{"anyOf":[{"type":"object","properties":{"plan":{"$ref":"#/components/schemas/PlanKey"},"interval":{"$ref":"#/components/schemas/BillingInterval"},"url":{"type":"string","description":"The billing page, for a person to pay for the plan. A plan cannot be bought by an API call."}},"required":["plan","interval","url"]},{"type":"null"}],"description":"Set when a plan was named."}},"required":["id","name","kind","baseCurrency","role","entitlement","checkout"]},"WorkspacePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceSummary"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ClientWorkspaces":{"type":"array","items":{"$ref":"#/components/schemas/ClientWorkspace"}},"Home":{"type":"object","properties":{"timeSensitive":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["BLOCKED_REPORT","LOCKED_BANK","NEEDS_DEPOSIT_ACCOUNT","UNUSUAL_CARD_CHARGE","INTEGRITY_REVIEW","TRIAL_ENDING"]},"title":{"type":"string"},"detail":{"type":"string"},"action":{"type":"string","description":"What the button does."},"href":{"type":"string"}},"required":["kind","title","detail","action","href"]},"description":"What can stop this person's work today. Each shows only while it applies."},"todos":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["REVIEW_AND_SUBMIT","APPROVE","PAY","EXPORT","FIX"]},"label":{"type":"string"},"count":{"type":"number"},"href":{"type":"string"}},"required":["kind","label","count","href"]},"description":"What a report cannot move forward without, by what this person can do."},"upcomingTravel":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"origin":{"type":["string","null"]},"destination":{"type":["string","null"]},"departsOn":{"type":"string"},"returnsOn":{"type":["string","null"]}},"required":["id","name","origin","destination","departsOn","returnsOn"]}},"insights":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"href":{"type":"string"}},"required":["text","href"]},"description":"Plain sentences worked out from this person's own expenses."},"announcements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"body":{"type":"string"},"linkUrl":{"type":["string","null"]},"publishedAt":{"type":"string"}},"required":["id","title","body","linkUrl","publishedAt"]}},"spend":{"anyOf":[{"type":"object","properties":{"currency":{"type":"string"},"awaitingApprovalMinor":{"type":"number"},"repaidLast30DaysMinor":{"type":"number"},"cards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]},"transactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string"},"merchant":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"}},"required":["id","date","merchant","amountMinor","currency"]}}},"required":["id","name","last4","transactions"]}}},"required":["currency","awaitingApprovalMinor","repaidLast30DaysMinor","cards"]},{"type":"null"}],"description":"Null for someone with no spending to see."}},"required":["timeSensitive","todos","upcomingTravel","insights","announcements","spend"]},"ReportApprovalLink":{"type":"object","properties":{"state":{"type":"string","enum":["OPEN","APPROVED","SETTLED"],"description":"OPEN can be approved or rejected. APPROVED can be marked paid. SETTLED is over, and holds no figures."},"note":{"type":["string","null"]},"reference":{"type":"string"},"title":{"type":"string"},"workspaceName":{"type":"string"},"ownerName":{"type":"string"},"purpose":{"type":["string","null"]},"currency":{"type":"string"},"totalMinor":{"type":"number"},"reimbursableMinor":{"type":"number"},"periodStart":{"type":["string","null"]},"periodEnd":{"type":["string","null"]},"expiresAt":{"type":"string"},"expenses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"date":{"type":"string"},"merchantName":{"type":["string","null"]},"category":{"type":["string","null"]},"amountMinor":{"type":"number"},"currency":{"type":"string"},"receiptUrl":{"description":"A signed link that lasts 15 minutes.","type":["string","null"]}},"required":["id","reference","date","merchantName","category","amountMinor","currency","receiptUrl"]}}},"required":["state","note","reference","title","workspaceName","ownerName","purpose","currency","totalMinor","reimbursableMinor","periodStart","periodEnd","expiresAt","expenses"]},"ExpensesMoved":{"type":"object","properties":{"moved":{"type":"number"},"skipped":{"type":"array","items":{"$ref":"#/components/schemas/SkippedExpense"}},"reportId":{"description":"The report they went to. Null when they came off every report.","type":["string","null"]}},"required":["moved","skipped","reportId"]},"ExpensesDuplicated":{"type":"object","properties":{"created":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"string","description":"The expense it was copied from."}},"required":["id","from"]}},"skipped":{"type":"array","items":{"$ref":"#/components/schemas/SkippedExpense"}}},"required":["created","skipped"]},"ExpensesHeld":{"type":"object","properties":{"changed":{"type":"number"},"skipped":{"type":"array","items":{"$ref":"#/components/schemas/SkippedExpense"}}},"required":["changed","skipped"]},"ProfilePhoto":{"type":"object","properties":{"photoUrl":{"type":"string","description":"A signed link that lasts 15 minutes."}},"required":["photoUrl"]},"PrivateDetailsCodeSent":{"type":"object","properties":{"status":{"type":"string","const":"SENT"},"email":{"type":"string","description":"Where the code went: the address this person signs in with."}},"required":["status","email"]},"PrivateDetailsUnlocked":{"type":"object","properties":{"details":{"$ref":"#/components/schemas/PrivateDetails"},"unlockToken":{"type":"string","description":"Saves without a new code until unlockedUntil."},"unlockedUntil":{"type":"string"}},"required":["details","unlockToken","unlockedUntil"]},"PrivateDetailsSaved":{"type":"object","properties":{"details":{"$ref":"#/components/schemas/PrivateDetails"}},"required":["details"]},"PeopleSync":{"type":"object","properties":{"systems":{"type":"array","items":{"$ref":"#/components/schemas/HrSystem"}},"connection":{"anyOf":[{"type":"object","properties":{"system":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["CONNECTED","NEEDS_ATTENTION","DISCONNECTED"]},"approvalMode":{"$ref":"#/components/schemas/HrApprovalMode"},"setupCompletedAt":{"description":"Nothing imports until setup is complete.","type":["string","null"]},"lastError":{"type":["string","null"]},"lastRunAt":{"type":["string","null"]},"manualLeft":{"description":"Syncs on demand left in the next 24 hours. Null for a file connection, which has nothing to read.","type":["number","null"]},"dropUrl":{"description":"The address a file or a webhook goes to.","type":["string","null"]}},"required":["system","name","status","approvalMode","setupCompletedAt","lastError","lastRunAt","manualLeft","dropUrl"]},{"type":"null"}]},"runs":{"type":"array","items":{"$ref":"#/components/schemas/PeopleSyncRun"}}},"required":["systems","connection","runs"]},"HrConnected":{"type":"object","properties":{"systems":{"type":"array","items":{"$ref":"#/components/schemas/HrSystem"}},"connection":{"anyOf":[{"type":"object","properties":{"system":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["CONNECTED","NEEDS_ATTENTION","DISCONNECTED"]},"approvalMode":{"$ref":"#/components/schemas/HrApprovalMode"},"setupCompletedAt":{"description":"Nothing imports until setup is complete.","type":["string","null"]},"lastError":{"type":["string","null"]},"lastRunAt":{"type":["string","null"]},"manualLeft":{"description":"Syncs on demand left in the next 24 hours. Null for a file connection, which has nothing to read.","type":["number","null"]},"dropUrl":{"description":"The address a file or a webhook goes to.","type":["string","null"]}},"required":["system","name","status","approvalMode","setupCompletedAt","lastError","lastRunAt","manualLeft","dropUrl"]},{"type":"null"}]},"runs":{"type":"array","items":{"$ref":"#/components/schemas/PeopleSyncRun"}},"dropToken":{"description":"The token in the file drop and webhook addresses. It shows this once.","type":["string","null"]}},"required":["systems","connection","runs","dropToken"]},"PeopleSyncRun":{"type":"object","properties":{"id":{"type":"string"},"trigger":{"type":"string","description":"SETUP, SCHEDULED, MANUAL, FILE or WEBHOOK."},"added":{"type":"number"},"updated":{"type":"number"},"removed":{"type":"number"},"skipped":{"type":"number"},"skips":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":"string"}},"required":["name","reason"]}},"error":{"type":["string","null"]},"startedAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","trigger","added","updated","removed","skipped","skips","error","startedAt","finishedAt"]},"InvoiceSettings":{"type":"object","properties":{"enabled":{"type":"boolean"},"supplierName":{"type":["string","null"]},"supplierAddress":{"type":["string","null"]},"taxNumbers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"One number per kind of tax number, by its label: VAT Number, ABN Number and so on."},"terms":{"type":["string","null"]}},"required":["enabled","supplierName","supplierAddress","taxNumbers","terms"]},"Invoice":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"reference":{"type":"string","description":"INV- and the number."},"status":{"$ref":"#/components/schemas/InvoiceStatus"},"displayStatus":{"$ref":"#/components/schemas/InvoiceDisplayStatus"},"title":{"type":["string","null"]},"recipientName":{"type":["string","null"]},"recipientEmail":{"type":["string","null"]},"recipientPhone":{"type":["string","null"]},"currency":{"type":"string"},"issueDate":{"type":"string"},"dueDate":{"type":["string","null"]},"totalMinor":{"type":"number"},"paidMinor":{"type":"number"},"refundedMinor":{"type":"number"},"balanceMinor":{"type":"number","description":"What is still owed: the total, less payments, plus anything refunded."},"sentAt":{"type":["string","null"]},"viewedAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"createdAt":{"type":"string"},"shareWith":{"type":"array","items":{"type":"string"}},"terms":{"type":["string","null"]},"supplierName":{"type":["string","null"]},"supplierAddress":{"type":["string","null"]},"supplierTaxLabel":{"type":["string","null"]},"supplierTaxNumber":{"type":["string","null"]},"subtotalMinor":{"type":"number"},"taxMinor":{"type":"number"},"lastReminderAt":{"type":["string","null"]},"reminderCount":{"type":"number"},"logoUrl":{"type":["string","null"]},"lines":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceLine"}},"payments":{"type":"array","items":{"$ref":"#/components/schemas/InvoicePayment"}},"messages":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceMessage"}},"link":{"description":"The recipient's link, once the invoice has gone out. Undoing the send stops it working.","type":["string","null"]}},"required":["id","number","reference","status","displayStatus","title","recipientName","recipientEmail","recipientPhone","currency","issueDate","dueDate","totalMinor","paidMinor","refundedMinor","balanceMinor","sentAt","viewedAt","paidAt","createdAt","shareWith","terms","supplierName","supplierAddress","supplierTaxLabel","supplierTaxNumber","subtotalMinor","taxMinor","lastReminderAt","reminderCount","logoUrl","lines","payments","messages","link"]},"InvoicePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceSummary"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"BulkInvoiceResult":{"type":"object","properties":{"created":{"type":"number"},"sent":{"type":"number"},"skipped":{"type":"number","description":"Rows of the file that were already imported."},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number"},"message":{"type":"string"}},"required":["row","message"]},"description":"One for each row that could not be read, in the file's own terms."}},"required":["created","sent","skipped","errors"]},"InvoicesToPay":{"type":"array","items":{"$ref":"#/components/schemas/InvoiceToPay"}},"PublicInvoice":{"type":"object","properties":{"reference":{"type":"string"},"displayStatus":{"$ref":"#/components/schemas/InvoiceDisplayStatus"},"title":{"type":["string","null"]},"recipientName":{"type":["string","null"]},"currency":{"type":"string"},"issueDate":{"type":"string"},"dueDate":{"type":["string","null"]},"terms":{"type":["string","null"]},"senderName":{"type":"string"},"supplierName":{"type":["string","null"]},"supplierAddress":{"type":["string","null"]},"supplierTaxLabel":{"type":["string","null"]},"supplierTaxNumber":{"type":["string","null"]},"subtotalMinor":{"type":"number"},"taxMinor":{"type":"number"},"totalMinor":{"type":"number"},"paidMinor":{"type":"number"},"refundedMinor":{"type":"number"},"balanceMinor":{"type":"number"},"logoUrl":{"type":["string","null"]},"lines":{"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"quantity":{"type":"number"},"unitMinor":{"type":"number"},"amountMinor":{"type":"number"},"taxKind":{"anyOf":[{"$ref":"#/components/schemas/InvoiceTaxKind"},{"type":"null"}]},"taxBasisPoints":{"description":"2000 is 20%.","type":["number","null"]},"taxMinor":{"type":"number"},"receiptUrl":{"description":"The receipt of a pulled-in expense: a signed link that lasts 15 minutes.","type":["string","null"]}},"required":["description","quantity","unitMinor","amountMinor","taxKind","taxBasisPoints","taxMinor","receiptUrl"]}},"payments":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["PAYMENT","REFUND"]},"amountMinor":{"type":"number"},"paidOn":{"type":"string"},"reference":{"type":["string","null"]}},"required":["kind","amountMinor","paidOn","reference"]}},"messages":{"type":"array","items":{"type":"object","properties":{"fromRecipient":{"type":"boolean"},"body":{"type":"string"},"createdAt":{"type":"string"}},"required":["fromRecipient","body","createdAt"]}}},"required":["reference","displayStatus","title","recipientName","currency","issueDate","dueDate","terms","senderName","supplierName","supplierAddress","supplierTaxLabel","supplierTaxNumber","subtotalMinor","taxMinor","totalMinor","paidMinor","refundedMinor","balanceMinor","logoUrl","lines","payments","messages"]},"MoneyFlow":{"type":"object","properties":{"currency":{"type":"string"},"months":{"type":"array","items":{"type":"object","properties":{"month":{"type":"string","description":"YYYY-MM."},"label":{"type":"string"},"moneyInMinor":{"type":"number"},"moneyOutMinor":{"type":"number"}},"required":["month","label","moneyInMinor","moneyOutMinor"]},"description":"Oldest first, by the same reckoning as the totals."}},"required":["currency","months"]},"ExpenseGroups":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseGroup"}},"BulkEditOptions":{"type":"object","properties":{"editable":{"type":"number","description":"How many of the selection this person may edit here. The rest are left out."},"skipped":{"type":"number"},"fields":{"type":"object","propertyNames":{"type":"string","enum":["merchantName","date","description","amountMinor","categoryId","projectId","billable","reimbursable","tagIds","attendees"]},"additionalProperties":{"type":"object","properties":{"open":{"type":"boolean"},"reason":{"type":["string","null"]}},"required":["open","reason"]},"required":["merchantName","date","description","amountMinor","categoryId","projectId","billable","reimbursable","tagIds","attendees"],"description":"A field restricted on any selected expense is closed, with the reason."},"tagLevels":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string"},"dependent":{"type":"boolean","description":"Picking one clears the levels below it."},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"parentId":{"type":["string","null"]}},"required":["id","name","parentId"]}}},"required":["level","dependent","tags"]}}},"required":["editable","skipped","fields","tagLevels"]},"BulkEditResult":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"number"}},"required":["updated","skipped"]},"SplitRows":{"type":"object","properties":{"parentId":{"type":"string"},"totalMinor":{"type":"number","description":"The whole they were split from, and what the parts may add up to."},"currency":{"type":"string"},"mustEqualTotal":{"type":"boolean","description":"Exactly the whole for a card or a per diem. Any figure up to it for cash and distance."},"amountOnly":{"type":"boolean","description":"Distance divides by amount only."},"reimbursableFixed":{"type":"boolean","description":"The workspace's cash rule or a card settles this, so nobody chooses."},"canEdit":{"type":"boolean","description":"Not once the report is approved, reimbursed or closed."},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"amountMinor":{"type":"number"},"date":{"type":"string"},"description":{"type":["string","null"]},"categoryId":{"type":["string","null"]},"tagIds":{"type":"array","items":{"type":"string"}},"reimbursable":{"type":"boolean"}},"required":["id","reference","amountMinor","date","description","categoryId","tagIds","reimbursable"]}}},"required":["parentId","totalMinor","currency","mustEqualTotal","amountOnly","reimbursableFixed","canEdit","rows"]},"ExpenseHistory":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"at":{"type":"string"},"action":{"type":"string"},"who":{"description":"Null for a change the system made.","type":["string","null"]},"attendees":{"anyOf":[{"type":"object","properties":{"added":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}},"required":["name"]}},"removed":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}},"required":["name"]}}},"required":["added","removed"]},{"type":"null"}]},"fields":{"type":"array","items":{"type":"string"},"description":"What changed."}},"required":["id","at","action","who","attendees","fields"]}}},"required":["data"]},"RecentAttendees":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}},"required":["name"]},"description":"People this person has listed lately, newest first."}},"required":["data"]},"PublicReceipt":{"type":"object","properties":{"filename":{"type":["string","null"]},"pages":{"type":"array","items":{"type":"string"},"description":"A signed link to each page. Each one lasts 15 minutes."}},"required":["filename","pages"]},"PublicReceiptLink":{"type":"object","properties":{"url":{"type":"string","description":"Opens the receipt for anyone who has it, while the workspace has public receipts on."}},"required":["url"]},"SpreadsheetText":{"type":"object","properties":{"csv":{"type":"string","description":"The first sheet as CSV, ready for an import route."}},"required":["csv"]},"TagLevels":{"type":"object","properties":{"levels":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"glCode":{"description":"The code on the way this tag was reached: a dependent list keeps one per path.","type":["string","null"]}},"required":["id","name","glCode"]}},"total":{"type":"number","description":"How many there are in all. Search for what the first few hundred leave out."},"waitingFor":{"description":"A level above this one has to be chosen first.","type":["string","null"]},"selected":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"glCode":{"description":"The code on the way this tag was reached: a dependent list keeps one per path.","type":["string","null"]}},"required":["id","name","glCode"]},{"type":"null"}]}},"required":["name","options","total","waitingFor","selected"]}},"dependent":{"type":"boolean"}},"required":["levels","dependent"]},"TagSuggestionList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"groupName":{"type":["string","null"]},"glCode":{"type":["string","null"]},"count":{"type":"number","description":"How many similar expenses carried it."}},"required":["id","name","groupName","glCode","count"]}}},"required":["data"]},"DocumentShareList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DocumentShare"}}},"required":["data"]},"DocumentShare":{"type":"object","properties":{"id":{"type":"string"},"owner":{"description":"Whose documents these are.","$ref":"#/components/schemas/ReportPerson"},"sharedWith":{"$ref":"#/components/schemas/ReportPerson"},"status":{"type":"string","enum":["ACTIVE","REQUESTED","REVOKED"]},"mine":{"type":"boolean","description":"True when the documents are the person asking's."},"createdAt":{"type":"string"}},"required":["id","owner","sharedWith","status","mine","createdAt"]},"DocumentSettings":{"type":"object","properties":{"s3":{"$ref":"#/components/schemas/S3Access"},"duplicates":{"type":"object","properties":{"similarityPercent":{"description":"How alike two images must be. Null keeps D-22's 10 bits.","type":["number","null"]},"amountToleranceMinor":{"type":"number"},"dayWindow":{"type":"number"},"rule":{"anyOf":[{"type":"object","properties":{"operator":{"type":"string","enum":["AND","OR"],"description":"AND needs every chosen field to match. OR needs any one of them."},"fields":{"type":"array","items":{"$ref":"#/components/schemas/DuplicateField"}}},"required":["operator","fields"]},{"type":"null"}],"description":"Replaces the same-vendor, same-amount, near-date check. Null keeps it."}},"required":["similarityPercent","amountToleranceMinor","dayWindow","rule"]},"lineItems":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Off keeps the totals and leaves the lines out."},"limit":{"description":"The most lines kept from one document. Null keeps them all.","type":["number","null"]}},"required":["enabled","limit"]},"maxPages":{"type":"number","description":"Pages read from one file."},"cropDocument":{"type":"boolean","description":"Finds the document in a photo or a scanned PDF, cuts it out and squares it, and makes several documents in one picture pages of this one. crop_document on a submission wins over this."},"emailAttachments":{"type":"string","enum":["combine","separate"],"description":"What several attachments on one email become: one document each, or one PDF. Expensify files each attachment as its own receipt and Veryfi combines them, so this is the workspace's choice. #bulkupload in a subject always separates them."},"fxRateDate":{"type":"string","enum":["submission","receipt"],"description":"Which day's rate converts a foreign receipt."},"asyncEnrichments":{"type":"array","items":{"$ref":"#/components/schemas/AsyncEnrichment"},"description":"Steps left to run after the first answer."},"customFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"pattern":{"type":"string","description":"Run on each line of text, at most CUSTOM_FIELD_PATTERN_LENGTH characters. The first group is the value, if there is one."},"level":{"type":"string","enum":["document","line"]}},"required":["name","pattern","level"]}}},"required":["s3","duplicates","lineItems","maxPages","cropDocument","emailAttachments","fxRateDate","asyncEnrichments","customFields"]},"InvitationAccepted":{"type":"object","properties":{"workspaceId":{"type":"string"},"workspaceName":{"type":"string"},"role":{"$ref":"#/components/schemas/MemberRole"}},"required":["workspaceId","workspaceName","role"]},"DelegationPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Delegation"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"DelegationCreated":{"anyOf":[{"$ref":"#/components/schemas/Delegation"},{"type":"object","properties":{"status":{"type":"string","const":"ACTIVE"},"delegation":{"$ref":"#/components/schemas/Delegation"}},"required":["status","delegation"]},{"type":"object","properties":{"status":{"type":"string","const":"INVITED"},"invitationId":{"type":"string"},"acceptUrl":{"type":"string"}},"required":["status","invitationId","acceptUrl"]}]},"Delegation":{"type":"object","properties":{"id":{"type":"string"},"permanent":{"type":"boolean","description":"Between an agent and its owner. It lasts as long as the agent, and nobody can change or remove it."},"delegator":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"delegate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"access":{"$ref":"#/components/schemas/DelegationAccess"},"startsAt":{"type":"string"},"endsAt":{"description":"Null runs until someone removes it.","type":["string","null"]},"active":{"type":"boolean","description":"Inside its window right now."}},"required":["id","permanent","delegator","delegate","access","startsAt","endsAt","active"]},"CopySettingsResult":{"type":"object","properties":{"sections":{"type":"array","items":{"$ref":"#/components/schemas/CopySection"}}},"required":["sections"]},"OffboardingList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OffboardingItem"}}},"required":["data"]},"AuditEventPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AuditEvent"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"DomainList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Domain"}}},"required":["data"]},"Domain":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["PENDING","VERIFIED"]},"workspaceId":{"type":"string"},"workspaceName":{"type":"string"},"joinPolicy":{"$ref":"#/components/schemas/DomainJoinPolicy"},"verification":{"type":"object","properties":{"host":{"type":"string"},"value":{"type":"string"}},"required":["host","value"],"description":"Where the TXT record goes and what it says."},"verifiedAt":{"type":["string","null"]},"lastCheckedAt":{"type":["string","null"]},"lastCheckError":{"type":["string","null"]},"adminCount":{"type":"number"},"pendingAccessRequests":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","name","status","workspaceId","workspaceName","joinPolicy","verification","verifiedAt","lastCheckedAt","lastCheckError","adminCount","pendingAccessRequests","createdAt"]},"DomainAccessRequested":{"type":"object","properties":{"status":{"type":"string","const":"PENDING"}},"required":["status"]},"DomainAccessRequestList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DomainAccessRequest"}}},"required":["data"]},"DomainAdminList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DomainAdmin"}}},"required":["data"]},"DomainMemberList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DomainMember"}}},"required":["data"]},"DomainReport":{"type":"object","properties":{"domain":{"type":"string"},"currency":{"type":"string"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/DomainReportRow"}}},"required":["domain","currency","rows"]},"DomainInviteResult":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","const":"INVITED"},"email":{"type":"string"},"acceptUrl":{"type":"string"}},"required":["status","email","acceptUrl"]},{"type":"object","properties":{"status":{"type":"string","const":"REOPENED"},"email":{"type":"string"},"userId":{"type":"string"}},"required":["status","email","userId"]}]},"DomainGroupList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DomainGroup"}}},"required":["data"]},"DomainGroup":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isDefault":{"type":"boolean"},"strictRules":{"type":"boolean"},"restrictLogin":{"type":"boolean"},"restrictWorkspaces":{"type":"boolean"},"preferredWorkspaceId":{"type":["string","null"]},"cardWorkspaceId":{"type":["string","null"]},"memberCount":{"type":"number"}},"required":["id","name","isDefault","strictRules","restrictLogin","restrictWorkspaces","preferredWorkspaceId","cardWorkspaceId","memberCount"]},"DomainMigration":{"type":"object","properties":{"id":{"type":["string","null"]},"fromDomain":{"type":"string"},"toDomain":{"type":"string"},"status":{"type":"string","enum":["PENDING","FAILED","DONE","RUNNING","PLANNED"]},"createdAt":{"type":["string","null"]},"finishedAt":{"type":["string","null"]},"moves":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"}},"required":["userId","from","to"]},"description":"Addresses that swap, old to new."},"skipped":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"reason":{"type":"string"}},"required":["email","reason"]},"description":"Who stays, and why."},"blockers":{"type":"array","items":{"type":"string"},"description":"What stops the whole move."}},"required":["id","fromDomain","toDomain","status","createdAt","finishedAt","moves","skipped","blockers"]},"JoinOptions":{"type":"object","properties":{"email":{"type":"string","description":"The address that proved these."},"workspaces":{"type":"array","items":{"$ref":"#/components/schemas/JoinableWorkspace"}}},"required":["email","workspaces"]},"JoinEmailSent":{"type":"object","properties":{"status":{"type":"string","const":"SENT"}},"required":["status"]},"JoinResult":{"type":"object","properties":{"status":{"type":"string","enum":["REQUESTED","JOINED"]},"workspaceId":{"type":"string"},"workspaceName":{"type":"string"}},"required":["status","workspaceId","workspaceName"]},"JoinLinkPreview":{"type":"object","properties":{"workspaceName":{"type":"string"},"role":{"$ref":"#/components/schemas/MemberRole"},"requiresApproval":{"type":"boolean"}},"required":["workspaceName","role","requiresApproval"]},"JoinLinkList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/JoinLink"}}},"required":["data"]},"JoinLink":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"role":{"$ref":"#/components/schemas/MemberRole"},"requiresApproval":{"type":"boolean"},"expiresAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","url","role","requiresApproval","expiresAt","createdAt"]},"JoinRequestList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/JoinRequest"}}},"required":["data"]},"ScimTokenList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScimToken"}}},"required":["data"]},"ScimTokenCreated":{"type":"object","properties":{"token":{"type":"string"},"baseUrl":{"type":"string","description":"What to paste into the identity provider."},"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"lastUsedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["token","baseUrl","id","name","prefix","lastUsedAt","expiresAt","createdAt"]},"EmailSignInSent":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]},"EmailSignInRedeemed":{"type":"object","properties":{"email":{"type":"string"},"link":{"description":"For signInWithEmailLink. A verified second address gets `customToken` instead.","type":["string","null"]},"customToken":{"type":["string","null"]}},"required":["email","link","customToken"]},"Unsubscribe":{"type":"object","properties":{"email":{"type":"string"},"type":{"description":"Null stopped every optional email.","type":["string","null"]},"label":{"type":["string","null"]}},"required":["email","type","label"]},"RecoveryCodes":{"type":"object","properties":{"remaining":{"type":"number"},"generatedAt":{"type":["string","null"]}},"required":["remaining","generatedAt"]},"RecoveryCodesIssued":{"type":"object","properties":{"codes":{"type":"array","items":{"type":"string"}},"remaining":{"type":"number"},"generatedAt":{"type":["string","null"]}},"required":["codes","remaining","generatedAt"]},"SessionList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Session"}}},"required":["data"]},"MergeStarted":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]},"AccountMerged":{"type":"object","properties":{"mergedEmail":{"type":"string"},"workspaces":{"type":"number","description":"Workspaces the other account was in that this one now holds."}},"required":["mergedEmail","workspaces"]},"OnboardingResult":{"type":"object","properties":{"workspaceId":{"type":["string","null"]}},"required":["workspaceId"]},"ReportArchiveList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReportArchive"}}},"required":["data"]},"ReportArchiveDetail":{"type":"object","properties":{"reports":{"type":"array","items":{"$ref":"#/components/schemas/ArchivedReport"}},"id":{"type":"string"},"workspaceName":{"type":"string"},"reportCount":{"type":"number"},"closedAt":{"type":"string"}},"required":["reports","id","workspaceName","reportCount","closedAt"]},"SsoConnectionOrNone":{"anyOf":[{"$ref":"#/components/schemas/SsoConnection"},{"type":"null"}]},"SsoConnection":{"type":"object","properties":{"id":{"type":"string"},"protocol":{"$ref":"#/components/schemas/SsoProtocol"},"providerId":{"type":"string"},"displayName":{"type":"string"},"idpEntityId":{"type":["string","null"]},"ssoUrl":{"type":["string","null"]},"certificateExpiresAt":{"type":["string","null"]},"clientId":{"type":["string","null"]},"issuer":{"type":["string","null"]},"enforced":{"type":"boolean"},"ownerExempt":{"type":"boolean"},"lastSignInAt":{"type":["string","null"]},"updatedAt":{"type":"string"}},"required":["id","protocol","providerId","displayName","idpEntityId","ssoUrl","certificateExpiresAt","clientId","issuer","enforced","ownerExempt","lastSignInAt","updatedAt"]},"SsoMetadata":{"type":"object","properties":{"filename":{"type":"string"},"xml":{"type":"string"}},"required":["filename","xml"]},"WorkspaceSecurity":{"type":"object","properties":{"ssoAvailable":{"type":"boolean","description":"This plan includes single sign-on."},"verifiedDomains":{"type":"array","items":{"type":"string"}},"connection":{"anyOf":[{"$ref":"#/components/schemas/SsoConnection"},{"type":"null"}]},"serviceProvider":{"$ref":"#/components/schemas/ServiceProvider"},"requireMfa":{"type":"boolean"},"signedInThroughProvider":{"type":"boolean","description":"This request came through the workspace's provider, so requiring it cannot lock this person out."},"hasSecondFactor":{"type":"boolean","description":"This request carries a second factor."}},"required":["ssoAvailable","verifiedDomains","connection","serviceProvider","requireMfa","signedInThroughProvider","hasSecondFactor"]},"SignInDiscovery":{"type":"object","properties":{"provider":{"anyOf":[{"$ref":"#/components/schemas/SignInProvider"},{"type":"null"}],"description":"Set when this address's domain has an identity provider."},"required":{"type":"boolean","description":"Password, Google and Apple will be refused for this address."}},"required":["provider","required"]},"StatusPage":{"type":"object","properties":{"measuredSince":{"description":"The first measurement there is. Null means nothing has been measured yet.","type":["string","null"]},"generatedAt":{"type":"string"},"components":{"type":"array","items":{"$ref":"#/components/schemas/StatusComponent"}},"incidents":{"type":"array","items":{"$ref":"#/components/schemas/StatusIncident"}}},"required":["measuredSince","generatedAt","components","incidents"]},"Me":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"emailVerified":{"type":"boolean"},"displayName":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"phone":{"type":["string","null"]},"language":{"description":"The language the interface is written in. `locale` only sets how figures print.","$ref":"#/components/schemas/UiLanguage"},"highContrast":{"type":"boolean"},"pronouns":{"type":["string","null"]},"personStatus":{"anyOf":[{"type":"object","properties":{"text":{"type":"string"},"clearsAt":{"type":["string","null"]}},"required":["text","clearsAt"]},{"type":"null"}],"description":"A note beside their name, until it clears."},"hasPrivateDetails":{"type":"boolean","description":"Whether anything is kept under the emailed code. The details never come back from here."},"locale":{"type":"string"},"timezone":{"type":"string"},"distanceUnit":{"type":"string"},"onboarded":{"type":"boolean"},"onboardingIntent":{"description":"What they said they came for on first run.","type":["string","null"]},"emailBounced":{"type":"boolean","description":"Their address bounced, so mail to it stopped until they fix it."},"phoneVerified":{"type":"boolean","description":"Firebase proved the number with a code."},"hasEmail":{"type":"boolean","description":"False for someone who came in with a phone number and has not added an address yet. `email` then holds an address nothing can be sent to."},"locked":{"type":"boolean","description":"Locked after a report of suspicious activity. Only support can undo it."},"canChangeEmail":{"type":"boolean","description":"A domain group can keep the sign-in address where the company put it."},"canManageWorkspaces":{"type":"boolean","description":"A domain group can stop someone creating or closing workspaces."},"defaultWorkspaceId":{"type":["string","null"]},"forwardingAddress":{"type":"string"},"workspaces":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceSummary"}}},"required":["id","email","emailVerified","displayName","photoUrl","phone","language","highContrast","pronouns","personStatus","hasPrivateDetails","locale","timezone","distanceUnit","onboarded","onboardingIntent","emailBounced","phoneVerified","hasEmail","locked","canChangeEmail","canManageWorkspaces","defaultWorkspaceId","forwardingAddress","workspaces"]},"ForwardingAlias":{"type":"object","properties":{"alias":{"type":"string"},"address":{"type":"string"}},"required":["alias","address"]},"CategoryAccess":{"type":"object","properties":{"userIds":{"type":"array","items":{"type":"string"}}},"required":["userIds"]},"MileageYear":{"type":"object","properties":{"distance":{"type":"number"}},"required":["distance"]},"RouteService":{"type":"object","properties":{"configured":{"type":"boolean"},"provider":{"type":["string","null"]}},"required":["configured","provider"]},"SavedPlaceList":{"type":"array","items":{"$ref":"#/components/schemas/SavedPlace"}},"SavedPlace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"address":{"type":"string"}},"required":["id","name","address"]},"RouteEstimate":{"type":"object","properties":{"provider":{"type":"string"},"attribution":{"type":"string","description":"Has to be shown beside the figures."},"unit":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"distance":{"type":"number"},"durationSeconds":{"type":"number"},"description":{"type":["string","null"]},"token":{"type":"string","description":"Sent back as `routeToken` with this distance and these addresses, it says a map measured the trip. Good for a day."}},"required":["distance","durationSeconds","description","token"]},"description":"The usual route first, then any alternatives. Alternatives only exist with no stops along the way."}},"required":["provider","attribution","unit","routes"]},"Commute":{"type":"object","properties":{"home":{"description":"Your home address, as you type it on a trip.","type":["string","null"]},"distance":{"description":"One way.","type":["number","null"]},"unit":{"type":"string","enum":["mi","km"]}},"required":["home","distance","unit"]},"DistanceSettings":{"type":"object","properties":{"requireGpsOrMap":{"type":"boolean","description":"Typed distances and odometer readings stop for new trips."},"requireLocked":{"type":"boolean","description":"Excluding commutes holds the requirement on."},"excludeCommutes":{"type":"string","enum":["NONE","ONE_WAY","BOTH_WAYS"]},"trackTax":{"type":"boolean"},"workspaceTaxBasisPoints":{"description":"Track tax needs one. Null is no taxes here.","type":["number","null"]},"government":{"type":"object","properties":{"currency":{"type":"string"},"available":{"type":"boolean"},"needsCountry":{"type":"boolean"},"enabled":{"type":"boolean"},"country":{"type":["string","null"]},"authority":{"type":["string","null"]},"unchecked":{"type":"boolean","description":"The figures behind this choice have not been checked against the source."},"reviewed":{"type":["string","null"]}},"required":["currency","available","needsCountry","enabled","country","authority","unchecked","reviewed"]}},"required":["requireGpsOrMap","requireLocked","excludeCommutes","trackTax","workspaceTaxBasisPoints","government"]},"MovedExpense":{"type":"object","properties":{"expenseId":{"type":"string"},"reference":{"type":"string"},"workspaceId":{"type":"string"},"workspaceName":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"rateMinor":{"description":"A trip's new rate, at a hundredth of a cent per unit.","type":["number","null"]},"rateName":{"type":["string","null"]},"distance":{"type":["number","null"]},"unit":{"type":["string","null"]}},"required":["expenseId","reference","workspaceId","workspaceName","amountMinor","currency","rateMinor","rateName","distance","unit"]},"PerDiemSettings":{"type":"object","properties":{"defaultCategoryId":{"type":["string","null"]},"defaultCategoryName":{"type":["string","null"]}},"required":["defaultCategoryId","defaultCategoryName"]},"BulkPerDiemResult":{"type":"object","properties":{"updated":{"type":"number"},"deleted":{"type":"number"}},"required":["updated","deleted"]},"ApprovalQueue":{"type":"object","properties":{"counts":{"$ref":"#/components/schemas/ApprovalCounts"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalQueueItem"}},"nextCursor":{"type":["string","null"]}},"required":["counts","data","nextCursor"]},"ReportSettings":{"type":"object","properties":{"autoReport":{"type":"object","properties":{"schedule":{"$ref":"#/components/schemas/AutoReportSchedule"},"weekday":{"description":"Weekly: 0 is Sunday.","type":"number"},"dayOfMonth":{"description":"Monthly, and the first date of twice a month: a day past the month's end means its last day, so 31 is always the last.","type":"number"},"secondDayOfMonth":{"description":"The second date of twice a month.","type":"number"},"titleTemplate":{"type":["string","null"]},"lastRun":{"type":["string","null"]}},"required":["schedule","lastRun"]},"randomAuditPercent":{"type":"number"},"preventSelfApproval":{"type":"boolean","description":"On, nobody approves their own report while someone else can."},"preventPayingNonReimbursable":{"type":"boolean","description":"On, a report with nothing reimbursable on it cannot be marked as paid."},"autoApproveCompliant":{"type":"boolean","description":"Off, no amount and no rule approves a report by itself."},"strictPolicies":{"type":"boolean"},"rulesEnabled":{"type":"boolean"},"prohibitedItems":{"type":"array","items":{"$ref":"#/components/schemas/ProhibitedItem"}},"titleFormula":{"type":["string","null"]},"titleLocked":{"type":"boolean"},"policyText":{"type":["string","null"]},"policyDocument":{"anyOf":[{"$ref":"#/components/schemas/PolicyDocument"},{"type":"null"}]},"cashExpenses":{"anyOf":[{"type":"string","enum":["REIMBURSABLE","NON_REIMBURSABLE","ALWAYS_REIMBURSABLE","ALWAYS_NON_REIMBURSABLE"]},{"type":"null"}]},"externalCheckUrl":{"type":["string","null"]},"showGlCodes":{"type":"boolean"},"publicReceipts":{"type":"boolean","description":"Anyone with a receipt's public link can open it, with no sign-in. Off unless someone turns it on."},"fringeBenefits":{"type":"boolean","description":"A category with payroll code TAG needs both attendee counts before it can be submitted."},"tagLevels":{"type":"array","items":{"type":"string"},"description":"Tag levels from the top down, as the last multi-level import named them."},"dependentTags":{"type":"boolean","description":"Lower levels filter to the combinations a dependent import listed."},"attendeeTracking":{"type":"boolean","description":"On, an expense can list who attended."},"billableExpenses":{"type":"string","enum":["DISABLED","DEFAULT_BILLABLE","DEFAULT_NON_BILLABLE"],"description":"Whether expenses can be billable, and what a new one starts as."}},"required":["autoReport","randomAuditPercent","preventSelfApproval","preventPayingNonReimbursable","autoApproveCompliant","strictPolicies","rulesEnabled","prohibitedItems","titleFormula","titleLocked","policyText","policyDocument","cashExpenses","externalCheckUrl","showGlCodes","publicReceipts","fringeBenefits","tagLevels","dependentTags","attendeeTracking","billableExpenses"]},"Policy":{"type":"object","properties":{"text":{"type":["string","null"]},"document":{"anyOf":[{"type":"object","properties":{"filename":{"type":"string"},"url":{"type":"string"},"uploadedAt":{"type":"string"}},"required":["filename","url","uploadedAt"]},{"type":"null"}],"description":"A short-lived link to the PDF."}},"required":["text","document"]},"ApprovalWorkflowList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalWorkflow"}}},"required":["data"]},"ApprovalWorkflow":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isDefault":{"type":"boolean"},"memberIds":{"type":"array","items":{"type":"string"},"description":"People whose reports take this workflow instead of the default."},"steps":{"type":"array","items":{"type":"object","properties":{"level":{"type":"number"},"kind":{"$ref":"#/components/schemas/ApprovalStepKind"},"userId":{"type":"string"},"inviteEmail":{"description":"Someone who is not a member yet. They are invited, and approve once they join.","type":"string"},"role":{"$ref":"#/components/schemas/MemberRole"},"overMinor":{"description":"The step applies only to reports over this amount, in the workspace currency.","type":"number"}},"required":["level","kind"]}},"autoApproveUnderMinor":{"type":["number","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","isDefault","memberIds","steps","autoApproveUnderMinor","createdAt","updatedAt"]},"PolicyRuleList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PolicyRule"}}},"required":["data"]},"PolicyRule":{"type":"object","properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/PolicyRuleType"},"severity":{"$ref":"#/components/schemas/PolicySeverity"},"enabled":{"type":"boolean"},"categoryId":{"type":["string","null"]},"amountMinor":{"type":["number","null"]},"days":{"type":["number","null"]},"note":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","type","severity","enabled","categoryId","amountMinor","days","note","createdAt","updatedAt"]},"SavedSearchList":{"type":"array","items":{"$ref":"#/components/schemas/SavedSearch"}},"SearchShortcuts":{"type":"object","properties":{"shortcuts":{"type":"array","items":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/SearchShortcutKey"},"label":{"type":"string"},"count":{"type":"number"},"reports":{"type":"array","items":{"$ref":"#/components/schemas/SearchShortcutReport"},"description":"Newest first, at most 50."}},"required":["key","label","count","reports"]},"description":"What your role in a workspace shared with others gives you, or what is waiting on you anywhere. Everyone has Drafts."}},"required":["shortcuts"]},"AccountingShortcutList":{"type":"object","properties":{"shortcuts":{"type":"array","items":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/AccountingShortcutKey"},"label":{"type":"string"},"description":{"type":"string"}},"required":["key","label","description"]},"description":"The shortcuts your role gives you, in this workspace."}},"required":["shortcuts"]},"AccountingShortcut":{"type":"object","properties":{"shortcut":{"$ref":"#/components/schemas/AccountingShortcutKey"},"currency":{"type":"string"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/AccountingRow"}},"groups":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"count":{"type":"number"},"totalMinor":{"type":"number"},"ageDays":{"type":"number","description":"How long the oldest row in it has been waiting, in days."},"accountId":{"type":["string","null"]}},"required":["key","label","from","to","count","totalMinor","ageDays","accountId"]}},{"type":"null"}],"description":"Set on card statements, and on accruals asked to group."},"footer":{"type":"object","properties":{"count":{"type":"number"},"totalMinor":{"type":"number","description":"In the base currency, of every row the filters select, not only the page. Credits are negative."}},"required":["count","totalMinor"]},"nextCursor":{"type":["string","null"]},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"The feeds the Feed filter offers, on the shortcuts that have one."}},"required":["shortcut","currency","rows","groups","footer","nextCursor","accounts"]},"BankReconciliationExpenses":{"type":"array","items":{"$ref":"#/components/schemas/BankReconciliationExpense"}},"CatalogReportList":{"type":"object","properties":{"reports":{"type":"array","items":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/CatalogReportKey"},"title":{"type":"string"},"description":{"type":"string"},"group":{"type":"string"}},"required":["key","title","description","group"]}}},"required":["reports"]},"CatalogReport":{"type":"object","properties":{"key":{"$ref":"#/components/schemas/CatalogReportKey"},"title":{"type":"string"},"description":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"currency":{"type":"string","description":"Every money column here is in this currency, the workspace's base."},"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["text","money","number","date"]}},"required":["key","label","kind"]}},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"expenseId":{"type":["string","null"]},"cells":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","null"]}}},"required":["id","expenseId","cells"]}},"totalMinor":{"description":"What the rows come to. Null for a report that is not about money.","type":["number","null"]},"truncated":{"type":"boolean","description":"There were more rows than one report reads."}},"required":["key","title","description","from","to","currency","columns","rows","totalMinor","truncated"]},"SavedSearch":{"type":"object","properties":{"columns":{"description":"Which columns the expense list shows for this search, in order. Without it, the reader's own.","anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/ExpenseColumn"}},{"type":"null"}]},"sort":{"description":"How the expense list sorts for this search. Without it, newest first.","anyOf":[{"$ref":"#/components/schemas/ExpenseSort"},{"type":"null"}]},"id":{"type":"string"},"name":{"type":"string"},"filters":{"type":"object","properties":{"scope":{"type":"string","enum":["mine","all"]},"status":{"anyOf":[{"$ref":"#/components/schemas/ExpenseStatus"},{"type":"array","items":{"$ref":"#/components/schemas/ExpenseStatus"}}]},"kind":{"$ref":"#/components/schemas/ExpenseKind"},"ownerId":{"type":"string"},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string"},"reportId":{"type":"string"},"externalId":{"description":"A developer's own reference, exactly as sent.","type":"string"},"minMinor":{"type":"number"},"maxMinor":{"type":"number"},"q":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"ids":{"description":"Export selected: only these expenses.","type":"array","items":{"type":"string"}},"year":{"description":"The fiscal year of a tax export.","type":"number"},"documentIds":{"description":"Export selected, for a documents export: only these documents.","type":"array","items":{"type":"string"}},"documentTypes":{"description":"A documents export of these types only.","type":"array","items":{"$ref":"#/components/schemas/DocumentType"}},"policyIds":{"description":"Workspace ids: the closest thing here to Expensify's policy list. A request works inside one workspace and a key is bound to one, so this can only ever confirm that workspace. The API answers 404 for any other id.","type":"array","items":{"type":"string"}},"reportState":{"description":"Reports in this state, or in any of these.","anyOf":[{"$ref":"#/components/schemas/ReportStatus"},{"type":"array","items":{"$ref":"#/components/schemas/ReportStatus"}}]},"reportIds":{"description":"Only these reports.","type":"array","items":{"type":"string"}},"startDate":{"description":"Reports submitted on or after this day, or created then if they were never submitted. Needs `endDate`.","type":"string"},"endDate":{"description":"Reports submitted on or before this day, or created then if they were never submitted. At most a year after `startDate`.","type":"string"},"approvedAfter":{"description":"Reports approved after this day. The day itself is left out, so the last run's date can be sent as it is.","type":"string"},"exported":{"description":"True takes reports already exported, false takes those not exported yet.","type":"boolean"},"paymentType":{"description":"Only expenses paid this way.","$ref":"#/components/schemas/PaymentType"},"moneyFlow":{"description":"Money out, or money in.","type":"string","enum":["IN","OUT"]},"dateField":{"description":"What `from` and `to` look at. Left out, the date on the receipt.","$ref":"#/components/schemas/ExpenseDateField"},"categoryIds":{"description":"These categories, however many.","type":"array","items":{"type":"string"}}}},"shared":{"type":"boolean"},"ownerId":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","name","filters","shared","ownerId","createdAt"]},"ExportTemplateList":{"type":"array","items":{"$ref":"#/components/schemas/ExportTemplate"}},"ExportTemplate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"description":"The heading in the file, when it should differ from the column's own name.","type":"string"},"formula":{"description":"Set when `key` is \"formula\". Parsed here, so a template that saves is a template that runs.","type":"string"}},"required":["key"]}},"shared":{"type":"boolean"},"ownerId":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","name","columns","shared","ownerId","createdAt"]},"ScheduledReportPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScheduledReport"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ScheduledReport":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"$ref":"#/components/schemas/ScheduledReportKind"},"format":{"$ref":"#/components/schemas/ExportFormat"},"filters":{"type":"object","properties":{"scope":{"type":"string","enum":["mine","all"]},"status":{"anyOf":[{"$ref":"#/components/schemas/ExpenseStatus"},{"type":"array","items":{"$ref":"#/components/schemas/ExpenseStatus"}}]},"kind":{"$ref":"#/components/schemas/ExpenseKind"},"ownerId":{"type":"string"},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string"},"reportId":{"type":"string"},"externalId":{"description":"A developer's own reference, exactly as sent.","type":"string"},"minMinor":{"type":"number"},"maxMinor":{"type":"number"},"q":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"ids":{"description":"Export selected: only these expenses.","type":"array","items":{"type":"string"}},"year":{"description":"The fiscal year of a tax export.","type":"number"},"documentIds":{"description":"Export selected, for a documents export: only these documents.","type":"array","items":{"type":"string"}},"documentTypes":{"description":"A documents export of these types only.","type":"array","items":{"$ref":"#/components/schemas/DocumentType"}},"policyIds":{"description":"Workspace ids: the closest thing here to Expensify's policy list. A request works inside one workspace and a key is bound to one, so this can only ever confirm that workspace. The API answers 404 for any other id.","type":"array","items":{"type":"string"}},"reportState":{"description":"Reports in this state, or in any of these.","anyOf":[{"$ref":"#/components/schemas/ReportStatus"},{"type":"array","items":{"$ref":"#/components/schemas/ReportStatus"}}]},"reportIds":{"description":"Only these reports.","type":"array","items":{"type":"string"}},"startDate":{"description":"Reports submitted on or after this day, or created then if they were never submitted. Needs `endDate`.","type":"string"},"endDate":{"description":"Reports submitted on or before this day, or created then if they were never submitted. At most a year after `startDate`.","type":"string"},"approvedAfter":{"description":"Reports approved after this day. The day itself is left out, so the last run's date can be sent as it is.","type":"string"},"exported":{"description":"True takes reports already exported, false takes those not exported yet.","type":"boolean"},"paymentType":{"description":"Only expenses paid this way.","$ref":"#/components/schemas/PaymentType"},"moneyFlow":{"description":"Money out, or money in.","type":"string","enum":["IN","OUT"]},"dateField":{"description":"What `from` and `to` look at. Left out, the date on the receipt.","$ref":"#/components/schemas/ExpenseDateField"},"categoryIds":{"description":"These categories, however many.","type":"array","items":{"type":"string"}}}},"cadence":{"$ref":"#/components/schemas/ReportCadence"},"recipients":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"nextRunAt":{"type":"string"},"lastRunAt":{"type":["string","null"]},"createdById":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","name","kind","format","filters","cadence","recipients","enabled","nextRunAt","lastRunAt","createdById","createdAt"]},"Outstanding":{"type":"object","properties":{"currency":{"type":"string"},"unbatchedMinor":{"type":"number"},"batchedMinor":{"type":"number"},"totalMinor":{"type":"number"},"payees":{"type":"array","items":{"$ref":"#/components/schemas/OutstandingPayee"}},"lastMethod":{"anyOf":[{"$ref":"#/components/schemas/ReimbursementMethod"},{"type":"null"}],"description":"How the last batch here was paid, to start the next one on."},"payer":{"anyOf":[{"$ref":"#/components/schemas/MoneyPerson"},{"type":"null"}],"description":"The designated payer, when the workspace named one."},"nothingOwed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"title":{"type":"string"},"owner":{"$ref":"#/components/schemas/MoneyPerson"}},"required":["id","reference","title","owner"]},"description":"Approved reports with nothing owed. Marking one paid is how it closes."}},"required":["currency","unbatchedMinor","batchedMinor","totalMinor","payees","lastMethod","payer","nothingOwed"]},"ReimbursementPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Reimbursement"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"NachaFile":{"type":"object","properties":{"entryCount":{"type":"number"},"entryHash":{"type":"string"},"totalCreditMinor":{"type":"number"},"blockCount":{"type":"number"},"effectiveDate":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"content":{"type":"string"}},"required":["entryCount","entryHash","totalCreditMinor","blockCount","effectiveDate","filename","contentType","content"]},"AbaFile":{"type":"object","properties":{"filename":{"type":"string"},"contentType":{"type":"string"},"content":{"type":"string"},"entryCount":{"type":"number"},"totalCreditMinor":{"type":"number"},"processOn":{"type":"string"}},"required":["filename","contentType","content","entryCount","totalCreditMinor","processOn"]},"ReimbursementSettings":{"type":"object","properties":{"payerId":{"description":"The person who is reminded of what is waiting to be paid. Anyone with the permission can still pay.","type":["string","null"]},"autoBatchUnderMinor":{"description":"Approved reports at or under this go into a batch by themselves, ready for the next file.","type":["number","null"]},"requireCardMatch":{"description":"A card expense needs its charge matched before the report can get its final approval.","type":["boolean","null"]},"detailsExport":{"description":"People who pay can download who is owed what on approved reports, with their bank details. Off until someone adds it.","type":["boolean","null"]}}},"AchOriginatorSetting":{"type":"object","properties":{"originator":{"anyOf":[{"type":"object","properties":{"bankRoutingNumber":{"type":"string","description":"The bank that sends the file on: Immediate Destination, and the Originating DFI."},"bankName":{"type":"string"},"companyName":{"type":"string"},"companyId":{"type":"string","description":"Assigned by the bank, usually 1 followed by the EIN."},"secCode":{"type":"string","enum":["PPD","CCD"],"description":"PPD pays a person's account, CCD pays a business account."},"entryDescription":{"type":"string","description":"What a payee sees on their statement."},"originId":{"description":"Immediate Origin, when the bank wants something other than the company ID.","type":["string","null"]},"originName":{"description":"The legal name, up to 23 characters. Defaults to the company name.","type":["string","null"]}},"required":["bankRoutingNumber","bankName","companyName","companyId","secCode","entryDescription"]},{"type":"null"}]}},"required":["originator"]},"AbaOriginatorSetting":{"type":"object","properties":{"originator":{"anyOf":[{"type":"object","properties":{"bankCode":{"type":"string","description":"Three letters for the bank, such as CBA or NAB."},"userName":{"type":"string","description":"The name the bank holds for you, up to 26 characters."},"userId":{"type":"string","description":"The Direct Entry User ID your bank gave you."},"bsb":{"type":"string","description":"What the account you pay from is, for the balancing entry."},"accountNumber":{"type":"string"},"description":{"type":"string","description":"What a payee sees on their statement."}},"required":["bankCode","userName","userId","bsb","accountNumber","description"]},{"type":"null"}]}},"required":["originator"]},"AbaOriginator":{"type":"object","properties":{"bankCode":{"type":"string","description":"Three letters for the bank, such as CBA or NAB."},"userName":{"type":"string","description":"The name the bank holds for you, up to 26 characters."},"userId":{"type":"string","description":"The Direct Entry User ID your bank gave you."},"bsb":{"type":"string","description":"What the account you pay from is, for the balancing entry."},"accountNumber":{"type":"string"},"description":{"type":"string","description":"What a payee sees on their statement."}},"required":["bankCode","userName","userId","bsb","accountNumber","description"]},"AchOriginator":{"type":"object","properties":{"bankRoutingNumber":{"type":"string","description":"The bank that sends the file on: Immediate Destination, and the Originating DFI."},"bankName":{"type":"string"},"companyName":{"type":"string"},"companyId":{"type":"string","description":"Assigned by the bank, usually 1 followed by the EIN."},"secCode":{"type":"string","enum":["PPD","CCD"],"description":"PPD pays a person's account, CCD pays a business account."},"entryDescription":{"type":"string","description":"What a payee sees on their statement."},"originId":{"description":"Immediate Origin, when the bank wants something other than the company ID.","type":["string","null"]},"originName":{"description":"The legal name, up to 23 characters. Defaults to the company name.","type":["string","null"]}},"required":["bankRoutingNumber","bankName","companyName","companyId","secCode","entryDescription"]},"PayeeBankAccountList":{"type":"array","items":{"$ref":"#/components/schemas/PayeeBankAccount"}},"PayeeBankAccount":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/MoneyPerson"},"holderName":{"type":"string"},"accountType":{"$ref":"#/components/schemas/BankAccountType"},"routingMasked":{"type":"string"},"accountMasked":{"type":"string"},"updatedAt":{"type":"string"}},"required":["user","holderName","accountType","routingMasked","accountMasked","updatedAt"]},"MyBankAccount":{"type":"object","properties":{"account":{"anyOf":[{"$ref":"#/components/schemas/PayeeBankAccount"},{"type":"null"}]}},"required":["account"]},"ReimbursementList":{"type":"array","items":{"$ref":"#/components/schemas/Reimbursement"}},"Reimbursement":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"reference":{"type":"string","description":"REI-0001."},"status":{"$ref":"#/components/schemas/ReimbursementStatus"},"method":{"$ref":"#/components/schemas/ReimbursementMethod"},"currency":{"type":"string"},"totalMinor":{"type":"number","description":"What the batch pays. For a batch in a NACHA file this is the file's figure."},"owedMinor":{"type":"number","description":"What its reports add up to now. Different from `totalMinor` when a file went out of date."},"paymentReference":{"description":"What a person typed as proof of payment: a check number or a payroll run.","type":["string","null"]},"note":{"type":["string","null"]},"paidOn":{"type":["string","null"]},"confirmedOn":{"description":"When the payee said the money arrived.","type":["string","null"]},"canReverse":{"type":"boolean","description":"A paid batch nothing went out for automatically can still be taken back."},"payee":{"$ref":"#/components/schemas/MoneyPerson"},"bankAccount":{"anyOf":[{"type":"object","properties":{"accountType":{"$ref":"#/components/schemas/BankAccountType"},"accountMasked":{"type":"string"}},"required":["accountType","accountMasked"]},{"type":"null"}]},"reports":{"type":"array","items":{"$ref":"#/components/schemas/ReimbursementReport"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","number","reference","status","method","currency","totalMinor","owedMinor","paymentReference","note","paidOn","confirmedOn","canReverse","payee","bankAccount","reports","createdAt","updatedAt"]},"BulkPaymentAccountResult":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"number"},"expensesRemoved":{"type":"number"}},"required":["updated","skipped","expensesRemoved"]},"StatementPreview":{"type":"object","properties":{"format":{"type":"string","enum":["CSV","XLSX","IIF","OFX","QFX"]},"headers":{"type":"array","items":{"type":"string"},"description":"Empty for OFX and QFX, which need no mapping."},"sample":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"rowCount":{"type":"number"},"suggested":{"anyOf":[{"type":"object","properties":{"date":{"type":"string"},"description":{"type":"string"},"dateOrder":{"type":"string","enum":["YMD","MDY","DMY"]},"spendIs":{"type":"string","enum":["POSITIVE","NEGATIVE"],"description":"Whether a purchase is positive or negative in the amount column. Ignored with debit and credit."},"decimalSeparator":{"type":"string","enum":[",","."]},"amount":{"description":"One signed column, or `debit` and `credit` for a file that splits them.","type":"string"},"debit":{"type":"string"},"credit":{"type":"string"},"merchant":{"type":"string"},"externalId":{"description":"The bank's own id for a row. Without one, a stable hash of the row stands in.","type":"string"},"currency":{"type":"string"},"fixedCurrency":{"description":"The currency of every row, for a file with no currency column.","type":"string"},"card":{"description":"Which card a row belongs to, in a file holding several: a number, a name or last four digits.","type":"string"},"employeeId":{"description":"The cardholder's employee ID, which assigns a card new to this workspace.","type":"string"},"category":{"type":"string"},"tag":{"type":"string"},"mcc":{"description":"The column holding the merchant category code, four digits.","type":"string"}},"required":["date","description","dateOrder","spendIs","decimalSeparator"]},{"type":"null"}]},"accountLast4":{"type":["string","null"]},"currency":{"type":["string","null"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"output":{"type":"array","items":{"$ref":"#/components/schemas/StatementOutputRow"},"description":"The first rows as they would be stored under the mapping sent, or the suggested one."},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number"},"message":{"type":"string"}},"required":["row","message"]},"description":"What that mapping could not read."}},"required":["format","headers","sample","rowCount","suggested","accountLast4","currency","from","to","output","errors"]},"StatementFeedImportResult":{"type":"object","properties":{"cards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last4":{"type":["string","null"]},"created":{"type":"number"}},"required":["id","name","last4","created"]}},"format":{"type":"string","enum":["CSV","XLSX","IIF","OFX","QFX"]},"parsed":{"type":"number"},"created":{"type":"number"},"duplicates":{"type":"number","description":"Rows not added: already imported, or held back. A statement imported twice adds nothing."},"heldBack":{"type":"number","description":"How many of `duplicates` are only look-alikes, not the same id. These can be forced in."},"beforeStartDate":{"type":"number","description":"Dated before the account's transaction start date, so left out."},"expensesCreated":{"type":"number","description":"Expenses made from new charges, when asked for."},"heldBackRows":{"type":"array","items":{"$ref":"#/components/schemas/HeldBackRow"},"description":"The first few held back, to judge by."},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number"},"message":{"type":"string"}},"required":["row","message"]},"description":"Rows that could not be read, with the line they came from."},"from":{"type":["string","null"]},"to":{"type":["string","null"]}},"required":["cards","format","parsed","created","duplicates","heldBack","beforeStartDate","expensesCreated","heldBackRows","errors","from","to"]},"StatementImportResult":{"type":"object","properties":{"format":{"type":"string","enum":["CSV","XLSX","IIF","OFX","QFX"]},"parsed":{"type":"number"},"created":{"type":"number"},"duplicates":{"type":"number","description":"Rows not added: already imported, or held back. A statement imported twice adds nothing."},"heldBack":{"type":"number","description":"How many of `duplicates` are only look-alikes, not the same id. These can be forced in."},"beforeStartDate":{"type":"number","description":"Dated before the account's transaction start date, so left out."},"expensesCreated":{"type":"number","description":"Expenses made from new charges, when asked for."},"heldBackRows":{"type":"array","items":{"$ref":"#/components/schemas/HeldBackRow"},"description":"The first few held back, to judge by."},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number"},"message":{"type":"string"}},"required":["row","message"]},"description":"Rows that could not be read, with the line they came from."},"from":{"type":["string","null"]},"to":{"type":["string","null"]}},"required":["format","parsed","created","duplicates","heldBack","beforeStartDate","expensesCreated","heldBackRows","errors","from","to"]},"CardLayoutList":{"type":"array","items":{"$ref":"#/components/schemas/CardLayout"}},"CardLayout":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"mapping":{"type":"object","properties":{"date":{"type":"string"},"description":{"type":"string"},"dateOrder":{"type":"string","enum":["YMD","MDY","DMY"]},"spendIs":{"type":"string","enum":["POSITIVE","NEGATIVE"],"description":"Whether a purchase is positive or negative in the amount column. Ignored with debit and credit."},"decimalSeparator":{"type":"string","enum":[",","."]},"amount":{"description":"One signed column, or `debit` and `credit` for a file that splits them.","type":"string"},"debit":{"type":"string"},"credit":{"type":"string"},"merchant":{"type":"string"},"externalId":{"description":"The bank's own id for a row. Without one, a stable hash of the row stands in.","type":"string"},"currency":{"type":"string"},"fixedCurrency":{"description":"The currency of every row, for a file with no currency column.","type":"string"},"card":{"description":"Which card a row belongs to, in a file holding several: a number, a name or last four digits.","type":"string"},"employeeId":{"description":"The cardholder's employee ID, which assigns a card new to this workspace.","type":"string"},"category":{"type":"string"},"tag":{"type":"string"},"mcc":{"description":"The column holding the merchant category code, four digits.","type":"string"}},"required":["date","description","dateOrder","spendIs","decimalSeparator"]},"updatedAt":{"type":"string"}},"required":["id","name","mapping","updatedAt"]},"BulkTransactionResult":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"message":{"type":"string"}},"required":["id","message"]},"description":"What was left as it was, each with why."}},"required":["updated","skipped"]},"PlaidStatus":{"type":"object","properties":{"configured":{"type":"boolean"},"environment":{"$ref":"#/components/schemas/ReleaseEnvironment"}},"required":["configured","environment"]},"PlaidItemList":{"type":"array","items":{"$ref":"#/components/schemas/PlaidItem"}},"PlaidLinkToken":{"type":"object","properties":{"linkToken":{"type":"string"},"expiration":{"type":"string"}},"required":["linkToken","expiration"]},"PlaidItem":{"type":"object","properties":{"id":{"type":"string"},"institutionName":{"type":["string","null"]},"status":{"type":"string"},"issue":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","enum":["ACCOUNT_NOT_FOUND","LOGIN_REQUIRED","INVALID_CREDENTIALS","TOO_MANY_ATTEMPTS","ACCOUNT_SETUP_REQUIRED","DIRECT_CONNECT_NOT_ENABLED","CARD_UPDATE_FAILED","GENERAL_CONNECTION_ISSUE","UNKNOWN_ERROR"]},"title":{"type":"string"},"message":{"type":"string"},"needsPerson":{"type":"boolean"}},"required":["code","title","message","needsPerson"]},{"type":"null"}],"description":"What is wrong, when something is. The title and message are shown as written."},"attention":{"type":"boolean","description":"Whether to show the red dot. It stops after 90 days without a sync, and `issue` stays."},"lastSyncedAt":{"type":["string","null"]},"accounts":{"type":"array","items":{"$ref":"#/components/schemas/PaymentAccount"}}},"required":["id","institutionName","status","issue","attention","lastSyncedAt","accounts"]},"BillingPlans":{"type":"object","properties":{"currency":{"type":"string","const":"USD"},"plans":{"type":"array","items":{"$ref":"#/components/schemas/BillingPlan"}},"trial":{"type":"object","properties":{"plan":{"$ref":"#/components/schemas/PlanKey"},"days":{"type":"number"}},"required":["plan","days"]}},"required":["currency","plans","trial"]},"BillingRedirect":{"type":"object","properties":{"url":{"type":"string"},"destination":{"type":"string","enum":["checkout","portal"]}},"required":["url","destination"]},"CashsdkToken":{"type":"object","properties":{"token":{"type":"string","description":"Send as X-CashSDK-User-Token."},"appUserId":{"type":"string","description":"The CashSDK app user id, which is the workspace id."},"expiresAt":{"type":"string"}},"required":["token","appUserId","expiresAt"]},"WorkspaceTransferred":{"type":"object","properties":{"ownerId":{"type":"string"},"ownerName":{"type":"string"}},"required":["ownerId","ownerName"]},"AccountDeletion":{"type":"object","properties":{"status":{"type":"string","const":"scheduled"},"purgeAfter":{"type":"string"},"closedWorkspaces":{"type":"array","items":{"$ref":"#/components/schemas/NamedWorkspace"},"description":"Workspaces that closed with the account."},"storeSubscriptions":{"type":"array","items":{"$ref":"#/components/schemas/StoreSubscriptionNotice"}}},"required":["status","purgeAfter","closedWorkspaces","storeSubscriptions"]},"ApiCallPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiCall"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"FraudSettings":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Off stops every check. A capture never depended on it."},"yellowAt":{"type":"number","description":"At or above this a document reads yellow."},"redAt":{"type":"number","description":"Above this a document reads red."},"profiles":{"type":"object","properties":{"RECEIPTS":{"type":"object","properties":{"signals":{"type":"object","properties":{"other":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"digital_tampering":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"fraudulent_pdf":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"fraudulent_image":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"generated_document":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"ai_generated":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"lcd_photo":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"screenshot":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"digital_background":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"not_a_document":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"duplicate":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"similar_documents":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"handwritten_characters":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"invalid_qr_data":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"invalid_mrz_data":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"suspicious_content":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"data_inconsistency":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"vendor_layout_mismatch":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"total_in_words_mismatch":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"aspect_ratio_mismatch":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"high_velocity":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"critical_velocity":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"multiple_profiles_or_devices":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"fraud_history":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"blocked_device":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]}}},"monitoredFields":{"type":"array","items":{"$ref":"#/components/schemas/FraudMonitoredField"}}},"required":["signals","monitoredFields"]},"CHECKS":{"type":"object","properties":{"signals":{"type":"object","properties":{"other":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"digital_tampering":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"fraudulent_pdf":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"fraudulent_image":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"generated_document":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"ai_generated":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"lcd_photo":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"screenshot":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"digital_background":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"not_a_document":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"duplicate":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"similar_documents":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"handwritten_characters":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"invalid_qr_data":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"invalid_mrz_data":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"suspicious_content":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"data_inconsistency":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"vendor_layout_mismatch":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"total_in_words_mismatch":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"aspect_ratio_mismatch":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"high_velocity":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"critical_velocity":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"multiple_profiles_or_devices":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"fraud_history":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"blocked_device":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]}}},"monitoredFields":{"type":"array","items":{"$ref":"#/components/schemas/FraudMonitoredField"}}},"required":["signals","monitoredFields"]},"BANK_STATEMENTS":{"type":"object","properties":{"signals":{"type":"object","properties":{"other":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"digital_tampering":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"fraudulent_pdf":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"fraudulent_image":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"generated_document":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"ai_generated":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"lcd_photo":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"screenshot":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"digital_background":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"not_a_document":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"duplicate":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"similar_documents":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"handwritten_characters":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"invalid_qr_data":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"invalid_mrz_data":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"suspicious_content":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"data_inconsistency":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"vendor_layout_mismatch":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"total_in_words_mismatch":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"aspect_ratio_mismatch":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"high_velocity":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"critical_velocity":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"multiple_profiles_or_devices":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"fraud_history":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]},"blocked_device":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold":{"type":"number"}},"required":["enabled","threshold"]}}},"monitoredFields":{"type":"array","items":{"$ref":"#/components/schemas/FraudMonitoredField"}}},"required":["signals","monitoredFields"]}},"required":["RECEIPTS","CHECKS","BANK_STATEMENTS"]},"suspiciousWords":{"type":"array","items":{"type":"string"},"description":"Mock or test receipt wording."},"pdfCreatorKeywords":{"type":"array","items":{"type":"string"},"description":"Extra PDF producers to treat as an editor, on top of the built-in list."},"velocity":{"type":"object","properties":{"high":{"type":"object","properties":{"lastMinutes":{"type":"number"},"lastDay":{"type":"number"},"lastWeek":{"type":"number"},"last2Weeks":{"type":"number"},"lastMonth":{"type":"number"}},"required":["lastMinutes","lastDay","lastWeek","last2Weeks","lastMonth"]},"critical":{"type":"object","properties":{"lastMinutes":{"type":"number"},"lastDay":{"type":"number"},"lastWeek":{"type":"number"},"last2Weeks":{"type":"number"},"lastMonth":{"type":"number"}},"required":["lastMinutes","lastDay","lastWeek","last2Weeks","lastMonth"]}},"required":["high","critical"]},"duplicateSpike":{"type":"object","properties":{"enabled":{"type":"boolean"},"percent":{"type":"number"},"minVolume":{"type":"number"}},"required":["enabled","percent","minVolume"],"description":"Hourly, for admins, at most three in 24 hours. Off until someone turns it on."}},"required":["enabled","yellowAt","redAt","profiles","suspiciousWords","pdfCreatorKeywords","velocity","duplicateSpike"]},"ClientCertificateEnforcement":{"type":"object","properties":{"required":{"type":"boolean"},"edgeConfigured":{"type":"boolean","description":"Whether this server is set up behind an edge that checks certificates. Without that, it cannot be required."},"activeCertificates":{"type":"number"}},"required":["required","edgeConfigured","activeCertificates"]},"ReleaseSubscriptionPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReleaseSubscription"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ReleaseSubscription":{"type":"object","properties":{"userId":{"type":"string"},"products":{"type":"array","items":{"$ref":"#/components/schemas/ReleaseProduct"},"description":"Empty means every product."},"addedById":{"description":"Who subscribed them, when it was not themselves.","type":["string","null"]},"lastNotifiedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["userId","products","addedById","lastNotifiedAt","createdAt"]},"ConnectResult":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]},"DisconnectResult":{"type":"object","properties":{"revoked":{"type":"boolean","description":"False when the provider could not confirm. PaperTotal has dropped the tokens either way."},"grantKeptFor":{"description":"Another connection still rests on the same grant at the provider, so it was left in place on purpose.","type":"string"}},"required":["revoked"]},"Mappings":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/IntegrationProvider"},"slug":{"type":"string"},"pulledAt":{"description":"When the reference data last arrived; null means the first pull has not finished.","type":["string","null"]},"rows":{"type":"array","items":{"$ref":"#/components/schemas/MappingRow"}},"options":{"type":"object","properties":{"ACCOUNT":{"type":"array","items":{"$ref":"#/components/schemas/MappingOption"}},"PAYMENT_ACCOUNT":{"type":"array","items":{"$ref":"#/components/schemas/MappingOption"}},"VENDOR":{"type":"array","items":{"$ref":"#/components/schemas/MappingOption"}},"CUSTOMER":{"type":"array","items":{"$ref":"#/components/schemas/MappingOption"}},"CLASS":{"type":"array","items":{"$ref":"#/components/schemas/MappingOption"}},"TRACKING":{"type":"array","items":{"$ref":"#/components/schemas/MappingOption"}},"TAX_CODE":{"type":"array","items":{"$ref":"#/components/schemas/MappingOption"}},"ITEM":{"type":"array","items":{"$ref":"#/components/schemas/MappingOption"}},"LOCATION":{"type":"array","items":{"$ref":"#/components/schemas/MappingOption"}},"DEPARTMENT":{"type":"array","items":{"$ref":"#/components/schemas/MappingOption"}},"EMPLOYEE":{"type":"array","items":{"$ref":"#/components/schemas/MappingOption"}},"CUSTOM_DIMENSION":{"type":"array","items":{"$ref":"#/components/schemas/MappingOption"}},"EXPENSE_CATEGORY":{"type":"array","items":{"$ref":"#/components/schemas/MappingOption"}},"PAYABLE_ACCOUNT":{"type":"array","items":{"$ref":"#/components/schemas/MappingOption"}}},"required":["ACCOUNT","PAYMENT_ACCOUNT","VENDOR","CUSTOMER","CLASS","TRACKING","TAX_CODE","ITEM","LOCATION","DEPARTMENT","EMPLOYEE","CUSTOM_DIMENSION","EXPENSE_CATEGORY","PAYABLE_ACCOUNT"]}},"required":["provider","slug","pulledAt","rows","options"]},"SaveMappingsResult":{"type":"object","properties":{"saved":{"type":"number"},"released":{"type":"number","description":"Records that were waiting on a mapping and are posting now."}},"required":["saved","released"]},"SyncResult":{"type":"object","properties":{"queued":{"type":"number"},"alreadyPosted":{"description":"Already in the books and left out. Present only when there are some.","type":"number"},"duplicateWarning":{"description":"Sent instead of posting: asking again with `confirmDuplicate` makes a second entry for each.","type":"string"}},"required":["queued"]},"SyncRecord":{"type":"object","properties":{"id":{"type":"string"},"expenseId":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"state":{"$ref":"#/components/schemas/SyncState"},"externalType":{"type":["string","null"]},"externalId":{"description":"The record in the other system.","type":["string","null"]},"errorCode":{"type":["string","null"]},"message":{"type":["string","null"]},"attempts":{"type":"number"},"syncedAt":{"type":["string","null"]},"nextAttemptAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"paidBy":{"anyOf":[{"type":"string","enum":["PROVIDER","PAPERTOTAL"]},{"type":"null"}]},"paymentError":{"type":["string","null"]},"resends":{"type":"number"}},"required":["id","expenseId","reference","merchantName","date","amountMinor","currency","state","externalType","externalId","errorCode","message","attempts","syncedAt","nextAttemptAt"]},"Forwarding":{"type":"object","properties":{"address":{"type":"string","description":"receipts+<token>@..., works from any address."},"alias":{"description":"The address a person chose, beside the random one. Both work.","type":["string","null"]},"aliasAddress":{"type":["string","null"]},"acceptsMerchantCc":{"type":"boolean","description":"Takes receipts a merchant copies to the shared address, addressed to this person."},"sharedAddress":{"type":"string","description":"receipts@..., works only from a verified address."},"signIn":{"type":"object","properties":{"email":{"type":"string"},"verified":{"type":"boolean"}},"required":["email","verified"]},"senders":{"type":"array","items":{"$ref":"#/components/schemas/ForwardingSender"}}},"required":["address","alias","aliasAddress","acceptsMerchantCc","sharedAddress","signIn","senders"]},"ForwardingSender":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"verified":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","email","verified","createdAt"]},"ApiKeyCreated":{"type":"object","properties":{"key":{"type":"string"},"clientSecret":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string","description":"The first characters of the key. The rest is not stored."},"scopes":{"type":"array","items":{"type":"string"}},"kind":{"type":"string","enum":["WORKSPACE","PERSONAL"]},"fullAccess":{"type":"boolean","description":"Every scope, present and future."},"environment":{"type":"string","enum":["LIVE","TEST"]},"managers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},"description":"Named people who may also see, change and revoke this key."},"hasClientSecret":{"type":"boolean","description":"True once a client secret has been issued, so a signature can be checked."},"signingRequired":{"type":"boolean","description":"A request with no valid signature is refused."},"rotatedFromId":{"description":"The key this one replaced.","type":["string","null"]},"rotatedToId":{"description":"The live key that replaced this one. Revoke this one once that is rolled out.","type":["string","null"]},"webhook":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"status":{"type":"string","enum":["PENDING","CONFIRMED"]},"enabled":{"type":"boolean"}},"required":["id","url","status","enabled"]},{"type":"null"}],"description":"This key's own endpoint, which hears about the documents it submits instead of the workspace's endpoints."},"lastUsedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"createdBy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},"allowed":{"type":"object","properties":{"widen":{"type":"boolean"},"issueSecrets":{"type":"boolean"}},"required":["widen","issueSecrets"],"description":"What the person asking may do beyond seeing it, renaming it, narrowing it and revoking it."}},"required":["key","id","name","prefix","scopes","kind","fullAccess","environment","managers","hasClientSecret","signingRequired","rotatedFromId","rotatedToId","webhook","lastUsedAt","expiresAt","revokedAt","createdAt","createdBy","allowed"]},"ApiKeyPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ApiKeyPermissions":{"type":"object","properties":{"scopes":{"type":"array","items":{"type":"object","properties":{"scope":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"method":{"type":"string"},"path":{"type":"string"}},"required":["method","path"]}}},"required":["scope","label","description","routes"]}},"presets":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}}},"required":["key","label","scopes"]}},"canMakeWorkspaceKeys":{"type":"boolean","description":"Whether this person may make a workspace key, or give one full access."}},"required":["scopes","presets","canMakeWorkspaceKeys"]},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string","description":"The first characters of the key. The rest is not stored."},"scopes":{"type":"array","items":{"type":"string"}},"kind":{"type":"string","enum":["WORKSPACE","PERSONAL"]},"fullAccess":{"type":"boolean","description":"Every scope, present and future."},"environment":{"type":"string","enum":["LIVE","TEST"]},"managers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},"description":"Named people who may also see, change and revoke this key."},"hasClientSecret":{"type":"boolean","description":"True once a client secret has been issued, so a signature can be checked."},"signingRequired":{"type":"boolean","description":"A request with no valid signature is refused."},"rotatedFromId":{"description":"The key this one replaced.","type":["string","null"]},"rotatedToId":{"description":"The live key that replaced this one. Revoke this one once that is rolled out.","type":["string","null"]},"webhook":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"status":{"type":"string","enum":["PENDING","CONFIRMED"]},"enabled":{"type":"boolean"}},"required":["id","url","status","enabled"]},{"type":"null"}],"description":"This key's own endpoint, which hears about the documents it submits instead of the workspace's endpoints."},"lastUsedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"createdBy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},"allowed":{"type":"object","properties":{"widen":{"type":"boolean"},"issueSecrets":{"type":"boolean"}},"required":["widen","issueSecrets"],"description":"What the person asking may do beyond seeing it, renaming it, narrowing it and revoking it."}},"required":["id","name","prefix","scopes","kind","fullAccess","environment","managers","hasClientSecret","signingRequired","rotatedFromId","rotatedToId","webhook","lastUsedAt","expiresAt","revokedAt","createdAt","createdBy","allowed"]},"ApiKeyClientSecret":{"type":"object","properties":{"clientSecret":{"type":"string"}},"required":["clientSecret"]},"SandboxState":{"type":"object","properties":{"sandbox":{"anyOf":[{"$ref":"#/components/schemas/Sandbox"},{"type":"null"}]}},"required":["sandbox"]},"Sandbox":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"parentId":{"type":"string","description":"The workspace it belongs to."},"parentName":{"type":"string"},"documentsUsed":{"type":"number","description":"Documents it has held, ever. Deleting one does not give it back."},"documentLimit":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","name","parentId","parentName","documentsUsed","documentLimit","createdAt"]},"OAuthConsent":{"type":"object","properties":{"client":{"type":"object","properties":{"name":{"type":"string"},"uri":{"type":["string","null"]},"logoUri":{"type":["string","null"]},"kind":{"type":"string","enum":["REGISTERED","DYNAMIC","METADATA"]},"clientId":{"type":"string"}},"required":["name","uri","logoUri","kind","clientId"],"description":"`kind` says how far to trust the name: a workspace registered it, it registered itself, or its own site describes it."},"redirectHost":{"type":"string","description":"Host of the address the answer goes to. Shown as it is, so a person can see where they are sending it."},"localOnly":{"type":"boolean","description":"Every redirect address on this client is this computer, so anything running here could pose as the app."},"resource":{"type":"string","enum":["api","mcp"]},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/OAuthScope"}},"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"}},"required":["id","name","role"]}}},"required":["client","redirectHost","localOnly","resource","scopes","workspaces"]},"OAuthRedirect":{"type":"object","properties":{"redirectTo":{"type":"string"}},"required":["redirectTo"]},"OAuthConnectionPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OAuthConnection"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"OAuthClientWithSecret":{"type":"object","properties":{"clientSecret":{"type":["string","null"]},"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"uri":{"type":["string","null"]},"logoUri":{"type":["string","null"]},"redirectUris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string"}},"public":{"type":"boolean"},"secretPrefix":{"description":"The first characters of the secret. The rest is not stored.","type":["string","null"]},"enabled":{"type":"boolean"},"connections":{"type":"number"},"createdAt":{"type":"string"}},"required":["clientSecret","id","clientId","name","uri","logoUri","redirectUris","scopes","public","secretPrefix","enabled","connections","createdAt"]},"OAuthClientPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OAuthClient"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"OAuthClient":{"type":"object","properties":{"id":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"uri":{"type":["string","null"]},"logoUri":{"type":["string","null"]},"redirectUris":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"string"}},"public":{"type":"boolean"},"secretPrefix":{"description":"The first characters of the secret. The rest is not stored.","type":["string","null"]},"enabled":{"type":"boolean"},"connections":{"type":"number"},"createdAt":{"type":"string"}},"required":["id","clientId","name","uri","logoUri","redirectUris","scopes","public","secretPrefix","enabled","connections","createdAt"]},"Inbox":{"type":"object","properties":{"rooms":{"type":"array","items":{"$ref":"#/components/schemas/Room"}},"todos":{"type":"array","items":{"$ref":"#/components/schemas/InboxTodo"}},"counts":{"type":"object","properties":{"all":{"type":"number"},"unread":{"type":"number"},"todos":{"type":"number"}},"required":["all","unread","todos"]},"priorityMode":{"$ref":"#/components/schemas/ChatPriorityMode"}},"required":["rooms","todos","counts","priorityMode"]},"ChatPersonList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChatPerson"}}},"required":["data"]},"ChatPreference":{"type":"object","properties":{"priorityMode":{"$ref":"#/components/schemas/ChatPriorityMode"}},"required":["priorityMode"]},"Room":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["ROOM","GROUP","DIRECT","THREAD","ASSISTANT"]},"name":{"type":"string"},"slug":{"type":["string","null"]},"description":{"type":["string","null"]},"systemKey":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"visibility":{"$ref":"#/components/schemas/RoomVisibility"},"posting":{"$ref":"#/components/schemas/RoomPosting"},"expenseId":{"type":["string","null"]},"reportId":{"type":["string","null"]},"memberCount":{"type":"number"},"joined":{"type":"boolean"},"canPost":{"type":"boolean"},"postRefusal":{"description":"Why this person cannot post here, as they should read it, or null when they can.","type":["string","null"]},"canManage":{"type":"boolean"},"peer":{"anyOf":[{"$ref":"#/components/schemas/ChatPerson"},{"type":"null"}],"description":"Who else is in a direct chat."},"pinned":{"type":"boolean"},"unread":{"type":"number"},"firstUnreadId":{"description":"The first message past what this person has read, where the New line goes.","type":["string","null"]},"lastMessageAt":{"type":["string","null"]},"lastMessage":{"type":["string","null"]}},"required":["id","kind","name","slug","description","systemKey","imageUrl","visibility","posting","expenseId","reportId","memberCount","joined","canPost","postRefusal","canManage","peer","pinned","unread","firstUnreadId","lastMessageAt","lastMessage"]},"MessageFlagList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MessageFlag"}}},"required":["data"]},"RoomList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["ROOM","GROUP","DIRECT","THREAD","ASSISTANT"]},"name":{"type":"string"},"slug":{"type":["string","null"]},"description":{"type":["string","null"]},"systemKey":{"type":["string","null"]},"imageUrl":{"type":["string","null"]},"visibility":{"$ref":"#/components/schemas/RoomVisibility"},"posting":{"$ref":"#/components/schemas/RoomPosting"},"expenseId":{"type":["string","null"]},"reportId":{"type":["string","null"]},"memberCount":{"type":"number"},"joined":{"type":"boolean"},"canPost":{"type":"boolean"},"postRefusal":{"description":"Why this person cannot post here, as they should read it, or null when they can.","type":["string","null"]},"canManage":{"type":"boolean"},"peer":{"anyOf":[{"$ref":"#/components/schemas/ChatPerson"},{"type":"null"}],"description":"Who else is in a direct chat."},"pinned":{"type":"boolean"},"unread":{"type":"number"},"firstUnreadId":{"description":"The first message past what this person has read, where the New line goes.","type":["string","null"]},"lastMessageAt":{"type":["string","null"]},"lastMessage":{"type":["string","null"]}},"required":["id","kind","name","slug","description","systemKey","imageUrl","visibility","posting","expenseId","reportId","memberCount","joined","canPost","postRefusal","canManage","peer","pinned","unread","firstUnreadId","lastMessageAt","lastMessage"]}}},"required":["data"]},"RoomMemberList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RoomMember"}}},"required":["data"]},"RoomInvite":{"type":"object","properties":{"url":{"type":"string","description":"Shown once. It opens the room to members of this workspace and to nobody else."},"code":{"type":"string"},"expiresAt":{"type":"string"}},"required":["url","code","expiresAt"]},"MessagePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"PostedMessage":{"type":"object","properties":{"unreachable":{"type":"array","items":{"$ref":"#/components/schemas/ChatPerson"},"description":"Members the message named who cannot read this room, so were not mentioned or told."},"id":{"type":"string"},"roomId":{"type":"string"},"kind":{"type":"string","enum":["SYSTEM","TEXT","ASSISTANT","TASK"]},"body":{"type":"string"},"author":{"anyOf":[{"$ref":"#/components/schemas/ChatPerson"},{"type":"null"}]},"mentions":{"type":"array","items":{"$ref":"#/components/schemas/ChatPerson"}},"rooms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"}},"required":["id","slug"]},"description":"#rooms the text names that this reader can open."},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"sizeBytes":{"type":"number"},"url":{"type":"string","description":"Signed for 15 minutes."}},"required":["id","filename","contentType","sizeBytes","url"]}},"parentId":{"type":["string","null"]},"replyCount":{"type":"number"},"lastReplyAt":{"type":["string","null"]},"whisper":{"type":"boolean","description":"Seen only by the person who asked."},"chart":{"anyOf":[{"$ref":"#/components/schemas/Chart"},{"type":"null"}]},"followUps":{"type":"array","items":{"type":"string"}},"runId":{"type":["string","null"]},"task":{"anyOf":[{"$ref":"#/components/schemas/Task"},{"type":"null"}]},"action":{"anyOf":[{"$ref":"#/components/schemas/PendingAction"},{"type":"null"}]},"editedAt":{"type":["string","null"]},"deleted":{"type":"boolean"},"hidden":{"type":"boolean"},"canEdit":{"type":"boolean","description":"Reserved for the people who may act on it, so a client never offers what the API would refuse."},"canDelete":{"type":"boolean"},"canModerate":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["unreachable","id","roomId","kind","body","author","mentions","rooms","attachments","parentId","replyCount","lastReplyAt","whisper","chart","followUps","runId","task","action","editedAt","deleted","hidden","canEdit","canDelete","canModerate","createdAt"]},"Message":{"type":"object","properties":{"id":{"type":"string"},"roomId":{"type":"string"},"kind":{"type":"string","enum":["SYSTEM","TEXT","ASSISTANT","TASK"]},"body":{"type":"string"},"author":{"anyOf":[{"$ref":"#/components/schemas/ChatPerson"},{"type":"null"}]},"mentions":{"type":"array","items":{"$ref":"#/components/schemas/ChatPerson"}},"rooms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"}},"required":["id","slug"]},"description":"#rooms the text names that this reader can open."},"attachments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"sizeBytes":{"type":"number"},"url":{"type":"string","description":"Signed for 15 minutes."}},"required":["id","filename","contentType","sizeBytes","url"]}},"parentId":{"type":["string","null"]},"replyCount":{"type":"number"},"lastReplyAt":{"type":["string","null"]},"whisper":{"type":"boolean","description":"Seen only by the person who asked."},"chart":{"anyOf":[{"$ref":"#/components/schemas/Chart"},{"type":"null"}]},"followUps":{"type":"array","items":{"type":"string"}},"runId":{"type":["string","null"]},"task":{"anyOf":[{"$ref":"#/components/schemas/Task"},{"type":"null"}]},"action":{"anyOf":[{"$ref":"#/components/schemas/PendingAction"},{"type":"null"}]},"editedAt":{"type":["string","null"]},"deleted":{"type":"boolean"},"hidden":{"type":"boolean"},"canEdit":{"type":"boolean","description":"Reserved for the people who may act on it, so a client never offers what the API would refuse."},"canDelete":{"type":"boolean"},"canModerate":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","roomId","kind","body","author","mentions","rooms","attachments","parentId","replyCount","lastReplyAt","whisper","chart","followUps","runId","task","action","editedAt","deleted","hidden","canEdit","canDelete","canModerate","createdAt"]},"MessageFlagged":{"type":"object","properties":{"flagged":{"type":"boolean"}},"required":["flagged"]},"TaskList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Task"}}},"required":["data"]},"Task":{"type":"object","properties":{"id":{"type":"string"},"roomId":{"type":"string"},"messageId":{"type":"string"},"title":{"type":"string"},"description":{"type":["string","null"]},"assignee":{"$ref":"#/components/schemas/ChatPerson"},"createdBy":{"$ref":"#/components/schemas/ChatPerson"},"status":{"type":"string","enum":["OPEN","DONE"]},"completedAt":{"type":["string","null"]},"canChange":{"type":"boolean","description":"What the person asking may do. Clients draw from these."},"createdAt":{"type":"string"}},"required":["id","roomId","messageId","title","description","assignee","createdBy","status","completedAt","canChange","createdAt"]},"SearchResults":{"type":"object","properties":{"query":{"type":"string"},"tookMs":{"type":"number"},"groups":{"type":"array","items":{"$ref":"#/components/schemas/SearchGroup"},"description":"Only the kinds with a hit, in `searchKinds` order."},"summary":{"anyOf":[{"$ref":"#/components/schemas/SearchSummary"},{"type":"null"}],"description":"Set when the search asks for `group-by:`."}},"required":["query","tookMs","groups","summary"]},"NotificationPage":{"type":"object","properties":{"unread":{"type":"number"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Notification"}},"nextCursor":{"type":["string","null"]}},"required":["unread","data","nextCursor"]},"UpdatedCount":{"type":"object","properties":{"updated":{"type":"number"}},"required":["updated"]},"Notification":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"title":{"type":"string"},"body":{"type":["string","null"]},"href":{"description":"Where in the app it leads, when it leads anywhere.","type":["string","null"]},"read":{"type":"boolean"},"createdAt":{"type":"string"}},"required":["id","type","title","body","href","read","createdAt"]},"NotificationPreferenceList":{"type":"array","items":{"$ref":"#/components/schemas/NotificationPreference"}},"ExpenseVendor":{"type":"object","properties":{"vendor":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"source":{"anyOf":[{"type":"string","enum":["MANUAL","RULE"]},{"type":"null"}],"description":"RULE when a merchant rule set it, MANUAL when an admin picked it."},"options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"provider":{"description":"The books this reads from, or null with nothing connected.","type":["string","null"]}},"required":["vendor","source","options","provider"]},"ExportSettings":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/IntegrationProvider"},"slug":{"type":"string"},"settings":{"type":"object","properties":{"preferredExporterId":{"description":"Hears about failed and finished exports. Null falls back to whoever connected.","type":["string","null"]},"autoSync":{"type":"boolean"},"exportDate":{"type":"string","enum":["EXPENSE_DATE","LAST_EXPENSE","SUBMITTED","EXPORTED"]},"reimbursableEntity":{"type":"string","enum":["BILL","CHECK","JOURNAL_ENTRY","EXPENSE_REPORT"]},"companyCardEntity":{"type":"string","enum":["BILL","JOURNAL_ENTRY","EXPENSE_REPORT","CREDIT_CARD","DEBIT_CARD"]},"defaultVendorId":{"description":"A VENDOR reference's external id, for a company-paid expense with no vendor of its own.","type":["string","null"]},"cardMisc":{"type":"boolean","description":"With no vendor and no default, post to Credit Card Misc or Debit Card Misc instead of stopping."},"billStatus":{"type":"string","enum":["SUBMITTED","DRAFT","AUTHORISED"]},"autoCreateVendors":{"type":"boolean"},"autoCreateCustomers":{"type":"boolean","description":"Customers too, where an invoice needs one."},"payableAccountId":{"description":"A PAYABLE_ACCOUNT reference's external id. A journal entry without tax credits this account.","type":["string","null"]},"reimbursableTiming":{"type":"string","enum":["ON_APPROVAL","ON_REIMBURSEMENT"]},"exportMethod":{"type":"string","enum":["ACCRUAL","CASH"]},"syncReimbursed":{"type":"boolean"},"billPaymentAccountId":{"description":"A PAYMENT_ACCOUNT reference's external id: what a bill payment comes out of.","type":["string","null"]},"postingCurrency":{"type":"string","enum":["HOME","ORIGINAL"]},"printLater":{"type":"boolean","description":"QuickBooks Desktop: checks wait in its print queue."},"nextOpenPeriod":{"type":"boolean","description":"NetSuite: a closed period moves the entry to the next open one instead of stopping it."},"customFormId":{"type":["string","null"]},"expenseReportApproval":{"type":"string","enum":["SUPERVISOR","ACCOUNTING","SUPERVISOR_AND_ACCOUNTING"]},"billApproval":{"anyOf":[{"type":"string","enum":["PENDING","APPROVED"]},{"type":"null"}]},"journalApproval":{"anyOf":[{"type":"string","enum":["PENDING","APPROVED"]},{"type":"null"}]},"enforceExpenseLimit":{"type":"boolean","description":"NetSuite: a report above the supervisor's Expense Limit stops rather than posts."}},"required":["preferredExporterId","autoSync","exportDate","reimbursableEntity","companyCardEntity","defaultVendorId","cardMisc","billStatus","autoCreateVendors","autoCreateCustomers","payableAccountId","reimbursableTiming","exportMethod","syncReimbursed","billPaymentAccountId","postingCurrency","printLater","nextOpenPeriod","customFormId","expenseReportApproval","billApproval","journalApproval","enforceExpenseLimit"]},"capabilities":{"$ref":"#/components/schemas/ExportCapabilities"},"exporters":{"type":"array","items":{"$ref":"#/components/schemas/MemberChoice"},"description":"People who may be the preferred exporter."},"vendors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"payableAccounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"paymentAccounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":["string","null"]}},"required":["id","name","type"]}},"taxEnabled":{"type":"boolean"},"multiCurrency":{"type":"boolean"},"paused":{"anyOf":[{"$ref":"#/components/schemas/PostingPause"},{"type":"null"}],"description":"Set while a failure holds automatic posting."}},"required":["provider","slug","settings","capabilities","exporters","vendors","payableAccounts","paymentAccounts","taxEnabled","multiCurrency","paused"]},"Import":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/IntegrationProvider"},"slug":{"type":"string"},"settings":{"type":"object","properties":{"prefixCategories":{"type":"boolean","description":"Category names start with the provider's name, so they read apart from the workspace's own."},"expenseClaimsOnly":{"type":"boolean","description":"Xero: only accounts marked Show in Expense Claims. Off brings every expense account with a code."},"items":{"type":"boolean","description":"Items you buy become categories, and lines post by item."},"taxes":{"type":"boolean"},"rebillCustomers":{"type":"boolean","description":"Customers become tags, so a billable expense can name who to bill."},"dimensions":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","enum":["OFF","TAGS","REPORT_FIELDS","EMPLOYEE_DEFAULT"]},"description":"By dimension key, as `importDimensions` lists them."},"intercompany":{"type":"boolean","description":"NetSuite: customers and projects from other subsidiaries too, which Intercompany Time and Expense allows."},"customLists":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"table":{"type":"string","description":"The record's script id: customrecord_cseg_region, customlist_region."},"field":{"type":"string","description":"The field on a transaction line: cseg_region, custcol_region."}},"required":["name","table","field"]},"description":"NetSuite's custom segments, records and lists. Nothing lists these, so a person names each."}},"required":["prefixCategories","expenseClaimsOnly","items","taxes","rebillCustomers","dimensions","intercompany","customLists"]},"dimensions":{"type":"array","items":{"$ref":"#/components/schemas/ImportDimension"}},"accounts":{"type":"number"},"items":{"type":"number"},"taxes":{"type":"number"},"taxRates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":["string","null"]},"valueBps":{"type":"number"},"type":{"type":["string","null"]},"isDefault":{"type":"boolean"},"active":{"type":"boolean"}},"required":["id","name","code","valueBps","type","isDefault","active"]}},"offersExpenseClaims":{"type":"boolean","description":"Xero alone marks accounts for expense claims."},"offersRebill":{"type":"boolean","description":"Customers can stand behind billable expenses as tags."},"offersCustomLists":{"type":"boolean","description":"NetSuite: custom lists and intercompany have a place."},"employees":{"type":"number","description":"People in the books with an address, who could be invited."},"pulledAt":{"type":["string","null"]},"last":{"anyOf":[{"$ref":"#/components/schemas/ImportSummary"},{"type":"null"}]}},"required":["provider","slug","settings","dimensions","accounts","items","taxes","taxRates","offersExpenseClaims","offersRebill","offersCustomLists","employees","pulledAt","last"]},"InviteEmployeesResult":{"type":"object","properties":{"invited":{"type":"number"},"skipped":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":"string"}},"required":["name","reason"]},"description":"Already here, already invited, or no seat left, each with the reason."}},"required":["invited","skipped"]},"Review":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/IntegrationProvider"},"slug":{"type":"string"},"name":{"type":"string"},"checksGst":{"type":"boolean","description":"Xero organisations file GST, so its review page checks it."},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"rows":{"type":"array","items":{"$ref":"#/components/schemas/ReviewRow"}}},"required":["provider","slug","name","checksGst","categories","rows"]},"VendorList":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/IntegrationProvider"},"slug":{"type":"string"},"name":{"type":"string"},"accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":["string","null"]}},"required":["id","name","code"]},"description":"What a vendor rule can point at."},"vendors":{"type":"array","items":{"$ref":"#/components/schemas/Vendor"}},"truncated":{"type":"boolean","description":"The list is longer than one page holds, so search narrows it."}},"required":["provider","slug","name","accounts","vendors","truncated"]},"Vendor":{"type":"object","properties":{"id":{"type":"string"},"externalId":{"type":"string"},"name":{"type":"string"},"email":{"type":["string","null"]},"active":{"type":"boolean","description":"The provider still lists it."},"enabled":{"type":"boolean","description":"A person left it switched on here."},"receipts":{"type":"number","description":"Expenses in this workspace that name it or its merchant."},"accountId":{"description":"The account its receipts post to, when a person saved a rule for it.","type":["string","null"]}},"required":["id","externalId","name","email","active","enabled","receipts","accountId"]},"VendorAccount":{"type":"object","properties":{"accountId":{"type":["string","null"]}},"required":["accountId"]},"GmailScan":{"type":"object","properties":{"mailbox":{"type":["string","null"]},"messagesSeen":{"type":"number","description":"Mail read since connecting."},"messagesFiled":{"type":"number","description":"How many of those became a document."},"scanningSince":{"description":"Mail received from here on is read. Null until the first scan has marked its place.","type":["string","null"]},"lastScanAt":{"type":["string","null"]},"scansUsedUp":{"type":"boolean","description":"The month's scans ran out. Scanning picks up from the same place when they come back."},"pausedUntil":{"description":"Gmail asked PaperTotal to wait until then.","type":["string","null"]}},"required":["mailbox","messagesSeen","messagesFiled","scanningSince","lastScanAt","scansUsedUp","pausedUntil"]},"SlackSettings":{"type":"object","properties":{"channels":{"type":"array","items":{"$ref":"#/components/schemas/SlackChannel"}},"channelsTruncated":{"type":"boolean","description":"The workspace has more channels than one list can hold."},"channelId":{"type":["string","null"]},"channelName":{"type":["string","null"]},"receipts":{"$ref":"#/components/schemas/SlackReceipts"},"approvalsReady":{"type":"boolean","description":"The server can verify a click. Without this, a button in Slack shows an error."}},"required":["channels","channelsTruncated","channelId","channelName","receipts","approvalsReady"]},"StorageStatus":{"type":"object","properties":{"provider":{"$ref":"#/components/schemas/IntegrationProvider"},"slug":{"type":"string"},"name":{"type":"string"},"account":{"type":["string","null"]},"backup":{"type":"object","properties":{"enabled":{"type":"boolean"},"folder":{"description":"Where it goes, once the first pass has made the folder.","type":["string","null"]},"done":{"type":"number","description":"Written to the folder, or brought in from it."},"skipped":{"type":"number","description":"Files the provider or the capture rules refused for good."},"waiting":{"type":"number"}},"required":["enabled","folder","done","skipped","waiting"]},"exports":{"$ref":"#/components/schemas/StorageFeature"},"intake":{"$ref":"#/components/schemas/StorageIntake"},"lastSyncedAt":{"type":["string","null"]}},"required":["provider","slug","name","account","backup","exports","intake","lastSyncedAt"]},"DesktopSetup":{"type":"object","properties":{"password":{"type":["string","null"]},"userName":{"type":"string"},"qwc":{"type":"string","description":"The file a person opens in the Web Connector. It holds no password."},"companyFile":{"type":["string","null"]},"lastRunAt":{"type":["string","null"]}},"required":["password","userName","qwc","companyFile","lastRunAt"]},"IifImport":{"type":"object","properties":{"accounts":{"type":"number"},"customers":{"type":"number"},"vendors":{"type":"number"},"items":{"type":"number"},"classes":{"type":"number"},"errors":{"type":"array","items":{"type":"object","properties":{"line":{"type":"number"},"message":{"type":"string"}},"required":["line","message"]},"description":"Lines that could not be read. The rest came in."}},"required":["accounts","customers","vendors","items","classes","errors"]},"TravelProfile":{"type":"object","properties":{"legalFirstName":{"type":["string","null"]},"legalMiddleName":{"type":["string","null"]},"legalLastName":{"type":["string","null"]},"birthDate":{"type":["string","null"]},"gender":{"type":["string","null"]},"phone":{"type":["string","null"]},"homeAddress":{"anyOf":[{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":"string"}}},{"type":"null"}]},"workAddress":{"anyOf":[{"type":"object","properties":{"line1":{"type":"string"},"line2":{"type":"string"},"city":{"type":"string"},"region":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":"string"}}},{"type":"null"}]},"emergencyName":{"type":["string","null"]},"emergencyRelationship":{"type":["string","null"]},"emergencyPhone":{"type":["string","null"]},"emergencyEmail":{"type":["string","null"]},"documents":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["PASSPORT","NATIONAL_ID","KNOWN_TRAVELER","REDRESS"]},"last4":{"type":"string","description":"The number itself never leaves."},"country":{"type":["string","null"]},"expiresOn":{"type":["string","null"]},"updatedAt":{"type":"string"}},"required":["type","last4","country","expiresOn","updatedAt"]}}},"required":["legalFirstName","legalMiddleName","legalLastName","birthDate","gender","phone","homeAddress","workAddress","emergencyName","emergencyRelationship","emergencyPhone","emergencyEmail","documents"]},"ReusableConnectorList":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string"},"workspaceName":{"type":"string"},"companyFile":{"type":["string","null"]}},"required":["connectionId","workspaceName","companyFile"]}},"AgentList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Agent"}}},"required":["data"]},"AgentTemplateList":{"type":"array","items":{"$ref":"#/components/schemas/AgentTemplate"}},"Agent":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"kind":{"type":"string","enum":["PERSONAL","RULEBOT"]},"name":{"type":"string"},"description":{"type":["string","null"]},"instructions":{"type":"string"},"templateKey":{"type":["string","null"]},"grants":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"limits":{"type":"object","properties":{"maxTotalMinor":{"type":"number"}}}},"required":["tool"]}},"owner":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"workspaces":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"waitingReports":{"type":"number","description":"Reports waiting on this agent right now. Deleting it is refused while this is above zero."},"roomId":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","userId","kind","name","description","instructions","templateKey","grants","owner","workspaces","waitingReports","roomId","createdAt"]},"AgentDraft":{"type":"object","properties":{"reply":{"type":"string"},"instructions":{"type":"string"},"behaviour":{"type":"string","description":"How it would behave, in plain words, so the person knows before they save."}},"required":["reply","instructions","behaviour"]},"AgentBulkDeleteResult":{"type":"object","properties":{"closed":{"type":"array","items":{"type":"string"}},"failed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"message":{"type":"string"}},"required":["id","message"]}}},"required":["closed","failed"]},"AgentActivityList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentActivity"}}},"required":["data"]},"AgentRule":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"prompt":{"type":"string"},"role":{"description":"Whether it only observes or may also decide a report.","$ref":"#/components/schemas/AgentRuleRole"},"plan":{"type":"object","properties":{"events":{"type":"array","items":{"type":"string","enum":["report.submitted","report.auto_approved","report.step_approved","report.approved","report.rejected","report.retracted","report.reopened","report.sent_back","report.expense_rejected","report.findings_accepted","expense.held","expense.released","report.created","report.updated","report.deleted","report.reassigned","report.closed","report.held_moved","report.expenses_added","report.expense_removed","report.approver_replaced","report.audit_sampled","report.moved","reimbursement.created","reimbursement.paid","report.reimbursed","reimbursement.failed","reimbursement.reversed","reimbursement.cancelled","reimbursement.overpaid","reimbursement.receipt_confirmed","reimbursement.delayed","reimbursement.returned","expense.reimbursement_stopped","expense.created","expense.updated","expense.voided","expense.restored","expense.split","expense.duplicate_kept","expense.receipt_merged","expense.receipt_attached","expense.receipt_replaced","expense.corrected","expense.violation_dismissed","document.created","document.deleted","document.processed","document.failed","comment.added","comment.mentioned","report.participant_added","report.participant_removed","room.member_added","room.member_removed","task.created","task.reassigned","task.completed","task.reopened","document.shared","payment_account.assigned","payment_account.unassigned","payment_account.created","payment_account.archived","plaid.connected","plaid.reconnected","plaid.removed","card.feed_broken","transaction.matched","transaction.unmatched","report.exported","export.requested","integration.sync_failed","integration.needs_attention","travel.trip_changed","billing.subscription_changed","billing.seats_changed","member.role_changed","member.suspended","member.updated","invitation.created","invitation.accepted","workflow.created","workflow.updated","workflow.deleted","policy.created","policy.updated","policy.deleted","budget.created","budget.updated","budget.deleted","integration.connected","integration.disconnected","payee_bank_account.saved","payee_bank_account.removed","reimbursement.settings_saved"]}},"branches":{"type":"array","items":{"type":"object","properties":{"when":{"type":"array","items":{"type":"object","properties":{"field":{"$ref":"#/components/schemas/AgentField"},"op":{"$ref":"#/components/schemas/AgentOperator"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}},{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2},{"type":"boolean"}]}},"required":["field","op","value"]}},"then":{"type":"array","items":{"type":"object","properties":{"tool":{"$ref":"#/components/schemas/AgentStepTool"},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]},"description":"Fixed when a person approved the rule. The subject is always what the event was about, so a step names no record."}},"required":["tool","input"]}},"ask":{"description":"A yes-or-no question a condition cannot settle. A reader with no tools answers it, and only a person can then write.","type":"string"}},"required":["when","then"]},"description":"The first branch whose conditions hold is the one that runs, so \"and all other reports\" is a last branch with none."}},"required":["events","branches"]},"enabled":{"type":"boolean"},"matchCount":{"type":"number"},"templateKey":{"type":["string","null"]},"approvedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},{"type":"null"}]},"approvedAt":{"type":"string"}},"required":["id","title","prompt","role","plan","enabled","matchCount","templateKey","approvedBy","approvedAt"]},"ReportMoved":{"type":"object","properties":{"id":{"type":"string"},"workspaceId":{"type":"string"},"reference":{"type":"string","description":"Its reference there. Numbers are each workspace's own."}},"required":["id","workspaceId","reference"]},"AgentInbox":{"type":"object","properties":{"rooms":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string"},"lastMessageAt":{"type":["string","null"]},"lastMessage":{"type":["string","null"]}},"required":["id","name","kind","lastMessageAt","lastMessage"]}},"waitingReports":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"title":{"type":"string"},"submitter":{"type":"string"},"totalMinor":{"type":"number"},"currency":{"type":"string"}},"required":["id","reference","title","submitter","totalMinor","currency"]},"description":"Reports waiting on it to approve."},"waitingCards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"summary":{"type":"string"},"expiresAt":{"type":"string"}},"required":["id","summary","expiresAt"]},"description":"What it proposed and is waiting on its owner to confirm."}},"required":["rooms","waitingReports","waitingCards"]},"ReportExplain":{"type":"object","properties":{"status":{"type":"string"},"decisions":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"title":{"type":"string"},"reason":{"type":"string"},"source":{"type":"string"},"runId":{"type":["string","null"]}},"required":["at","title","reason","source","runId"]}}},"required":["status","decisions"]},"AgentScheduleList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentSchedule"}}},"required":["data"]},"AgentSchedule":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":"string"},"title":{"type":"string"},"instruction":{"type":"string"},"cadence":{"type":"string"},"nextRunAt":{"type":"string"},"lastRunAt":{"type":["string","null"]},"enabled":{"type":"boolean"}},"required":["id","agentId","title","instruction","cadence","nextRunAt","lastRunAt","enabled"]},"AgentRuleList":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"prompt":{"type":"string"},"role":{"description":"Whether it only observes or may also decide a report.","$ref":"#/components/schemas/AgentRuleRole"},"plan":{"type":"object","properties":{"events":{"type":"array","items":{"type":"string","enum":["report.submitted","report.auto_approved","report.step_approved","report.approved","report.rejected","report.retracted","report.reopened","report.sent_back","report.expense_rejected","report.findings_accepted","expense.held","expense.released","report.created","report.updated","report.deleted","report.reassigned","report.closed","report.held_moved","report.expenses_added","report.expense_removed","report.approver_replaced","report.audit_sampled","report.moved","reimbursement.created","reimbursement.paid","report.reimbursed","reimbursement.failed","reimbursement.reversed","reimbursement.cancelled","reimbursement.overpaid","reimbursement.receipt_confirmed","reimbursement.delayed","reimbursement.returned","expense.reimbursement_stopped","expense.created","expense.updated","expense.voided","expense.restored","expense.split","expense.duplicate_kept","expense.receipt_merged","expense.receipt_attached","expense.receipt_replaced","expense.corrected","expense.violation_dismissed","document.created","document.deleted","document.processed","document.failed","comment.added","comment.mentioned","report.participant_added","report.participant_removed","room.member_added","room.member_removed","task.created","task.reassigned","task.completed","task.reopened","document.shared","payment_account.assigned","payment_account.unassigned","payment_account.created","payment_account.archived","plaid.connected","plaid.reconnected","plaid.removed","card.feed_broken","transaction.matched","transaction.unmatched","report.exported","export.requested","integration.sync_failed","integration.needs_attention","travel.trip_changed","billing.subscription_changed","billing.seats_changed","member.role_changed","member.suspended","member.updated","invitation.created","invitation.accepted","workflow.created","workflow.updated","workflow.deleted","policy.created","policy.updated","policy.deleted","budget.created","budget.updated","budget.deleted","integration.connected","integration.disconnected","payee_bank_account.saved","payee_bank_account.removed","reimbursement.settings_saved"]}},"branches":{"type":"array","items":{"type":"object","properties":{"when":{"type":"array","items":{"type":"object","properties":{"field":{"$ref":"#/components/schemas/AgentField"},"op":{"$ref":"#/components/schemas/AgentOperator"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}},{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2},{"type":"boolean"}]}},"required":["field","op","value"]}},"then":{"type":"array","items":{"type":"object","properties":{"tool":{"$ref":"#/components/schemas/AgentStepTool"},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]},"description":"Fixed when a person approved the rule. The subject is always what the event was about, so a step names no record."}},"required":["tool","input"]}},"ask":{"description":"A yes-or-no question a condition cannot settle. A reader with no tools answers it, and only a person can then write.","type":"string"}},"required":["when","then"]},"description":"The first branch whose conditions hold is the one that runs, so \"and all other reports\" is a last branch with none."}},"required":["events","branches"]},"enabled":{"type":"boolean"},"matchCount":{"type":"number"},"templateKey":{"type":["string","null"]},"approvedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},{"type":"null"}]},"approvedAt":{"type":"string"},"words":{"type":"array","items":{"type":"string"},"description":"The rule in plain words, as a person reads it before turning it on."}},"required":["id","title","prompt","role","plan","enabled","matchCount","templateKey","approvedBy","approvedAt","words"]}}},"required":["data"]},"SuggestedAgentRuleList":{"type":"array","items":{"$ref":"#/components/schemas/SuggestedAgentRule"}},"AgentRuleDescribed":{"type":"object","properties":{"title":{"type":"string"},"plan":{"anyOf":[{"type":"object","properties":{"events":{"type":"array","items":{"type":"string","enum":["report.submitted","report.auto_approved","report.step_approved","report.approved","report.rejected","report.retracted","report.reopened","report.sent_back","report.expense_rejected","report.findings_accepted","expense.held","expense.released","report.created","report.updated","report.deleted","report.reassigned","report.closed","report.held_moved","report.expenses_added","report.expense_removed","report.approver_replaced","report.audit_sampled","report.moved","reimbursement.created","reimbursement.paid","report.reimbursed","reimbursement.failed","reimbursement.reversed","reimbursement.cancelled","reimbursement.overpaid","reimbursement.receipt_confirmed","reimbursement.delayed","reimbursement.returned","expense.reimbursement_stopped","expense.created","expense.updated","expense.voided","expense.restored","expense.split","expense.duplicate_kept","expense.receipt_merged","expense.receipt_attached","expense.receipt_replaced","expense.corrected","expense.violation_dismissed","document.created","document.deleted","document.processed","document.failed","comment.added","comment.mentioned","report.participant_added","report.participant_removed","room.member_added","room.member_removed","task.created","task.reassigned","task.completed","task.reopened","document.shared","payment_account.assigned","payment_account.unassigned","payment_account.created","payment_account.archived","plaid.connected","plaid.reconnected","plaid.removed","card.feed_broken","transaction.matched","transaction.unmatched","report.exported","export.requested","integration.sync_failed","integration.needs_attention","travel.trip_changed","billing.subscription_changed","billing.seats_changed","member.role_changed","member.suspended","member.updated","invitation.created","invitation.accepted","workflow.created","workflow.updated","workflow.deleted","policy.created","policy.updated","policy.deleted","budget.created","budget.updated","budget.deleted","integration.connected","integration.disconnected","payee_bank_account.saved","payee_bank_account.removed","reimbursement.settings_saved"]}},"branches":{"type":"array","items":{"type":"object","properties":{"when":{"type":"array","items":{"type":"object","properties":{"field":{"$ref":"#/components/schemas/AgentField"},"op":{"$ref":"#/components/schemas/AgentOperator"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}},{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2},{"type":"boolean"}]}},"required":["field","op","value"]}},"then":{"type":"array","items":{"type":"object","properties":{"tool":{"$ref":"#/components/schemas/AgentStepTool"},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]},"description":"Fixed when a person approved the rule. The subject is always what the event was about, so a step names no record."}},"required":["tool","input"]}},"ask":{"description":"A yes-or-no question a condition cannot settle. A reader with no tools answers it, and only a person can then write.","type":"string"}},"required":["when","then"]},"description":"The first branch whose conditions hold is the one that runs, so \"and all other reports\" is a last branch with none."}},"required":["events","branches"]},{"type":"null"}],"description":"Null when the words could not become something code can enforce. `problem` says why."},"problem":{"type":["string","null"]},"words":{"type":"array","items":{"type":"string"}}},"required":["title","plan","problem","words"]},"AssistantStatus":{"type":"object","properties":{"configured":{"type":"boolean","description":"False until ANTHROPIC_API_KEY is set. The app says so plainly and everything else keeps working."},"message":{"type":["string","null"]}},"required":["configured","message"]},"AssistantRoom":{"type":"object","properties":{"roomId":{"type":"string"}},"required":["roomId"]},"AssistantAsk":{"type":"object","properties":{"roomId":{"type":"string"},"runId":{"type":"string"}},"required":["roomId","runId"]},"PendingAction":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["EXPIRED","FAILED","PROPOSED","EXECUTED","DECLINED"]},"summary":{"type":"string","description":"What it will do, written by code from the record, never the model's words."},"tainted":{"type":"boolean","description":"Something a person other than the asker wrote reached the assistant first. Read it before confirming."},"error":{"type":["string","null"]},"mine":{"type":"boolean"},"expiresAt":{"type":"string"}},"required":["id","status","summary","tainted","error","mine","expiresAt"]},"ExplainRun":{"type":"object","properties":{"id":{"type":"string"},"trigger":{"type":"string","enum":["ASK","EVENT","SCHEDULE"]},"status":{"type":"string"},"question":{"type":["string","null"]},"answer":{"type":["string","null"]},"reasoning":{"type":["string","null"]},"tainted":{"type":"boolean"},"rule":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"prompt":{"type":"string"}},"required":["id","title","prompt"]},{"type":"null"}],"description":"The rule it followed, and what that rule said."},"calls":{"type":"array","items":{"$ref":"#/components/schemas/ExplainCall"},"description":"What it read and what it did, in order."},"basis":{"description":"The facts the decision rested on."},"createdAt":{"type":"string"}},"required":["id","trigger","status","question","answer","reasoning","tainted","rule","calls","basis","createdAt"]},"ExpenseExplanation":{"type":"object","properties":{"category":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"source":{"type":["string","null"]},"reason":{"type":"string"}},"required":["name","source","reason"]},{"type":"null"}]},"decisions":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"title":{"type":"string"},"reason":{"type":"string"},"source":{"type":"string"},"runId":{"type":["string","null"]}},"required":["at","title","reason","source","runId"]}}},"required":["category","decisions"]},"InsightAnswer":{"type":"object","properties":{"question":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string","description":"Plain English, worked out from the figures below."},"from":{"type":"string"},"to":{"type":"string"},"currency":{"type":"string"},"totalMinor":{"type":"number"},"documents":{"type":"number","description":"Documents the figures cover."},"capped":{"type":"boolean","description":"True when more than 10,000 matched and the period was shortened to the latest 10,000."},"chart":{"$ref":"#/components/schemas/Chart"},"filters":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The filters behind the figures, to save through /v1/saved-searches."}},"required":["question","title","summary","from","to","currency","totalMinor","documents","capped","chart","filters"]},"DocumentUsage":{"type":"object","properties":{"period":{"type":"string"},"types":{"type":"array","items":{"type":"object","properties":{"added":{"type":"number"},"read":{"type":"number"},"reading":{"type":"number"},"failed":{"type":"number"},"type":{"$ref":"#/components/schemas/DocumentType"}},"required":["added","read","reading","failed","type"]}},"totals":{"$ref":"#/components/schemas/DocumentCounts"},"scope":{"type":"string","enum":["workspace","mine"],"description":"Everyone's documents, or only the caller's own: a member sees what they can open."}},"required":["period","types","totals","scope"]},"ProcessingReport":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"scope":{"type":"string","enum":["workspace","mine"]},"documents":{"type":"number"},"reading":{"type":"object","properties":{"count":{"type":"number","description":"How many documents the figures below are from."},"averageMs":{"type":["number","null"]},"medianMs":{"type":["number","null"]},"p90Ms":{"type":["number","null"]},"distribution":{"type":"array","items":{"$ref":"#/components/schemas/DurationBucket"}},"trend":{"type":"array","items":{"$ref":"#/components/schemas/DurationDay"}}},"required":["count","averageMs","medianMs","p90Ms","distribution","trend"],"description":"How long the reader took, for documents it timed."},"turnaround":{"description":"From upload to a result a person can see, for every document that has one.","$ref":"#/components/schemas/DurationSummary"},"fileTypes":{"type":"array","items":{"type":"object","properties":{"mimeType":{"type":"string"},"count":{"type":"number"}},"required":["mimeType","count"]}},"sources":{"type":"array","items":{"type":"object","properties":{"source":{"$ref":"#/components/schemas/DocumentSource"},"count":{"type":"number"}},"required":["source","count"]}},"averageSizeBytes":{"type":["number","null"]},"averagePages":{"type":["number","null"]}},"required":["from","to","scope","documents","reading","turnaround","fileTypes","sources","averageSizeBytes","averagePages"]},"ChatEvent":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message.created","message.updated","message.deleted"]},"workspaceId":{"type":"string"},"roomId":{"type":"string"},"messageId":{"type":"string"},"parentId":{"type":["string","null"]},"subject":{"type":"object","properties":{"reportId":{"type":"string"},"expenseId":{"type":"string"}}}},"required":["type","workspaceId","roomId","messageId"]},{"type":"object","properties":{"type":{"type":"string","enum":["room.updated","room.read","room.removed"]},"workspaceId":{"type":"string"},"roomId":{"type":"string"}},"required":["type","workspaceId","roomId"]},{"type":"object","properties":{"type":{"type":"string","const":"assistant.delta"},"workspaceId":{"type":"string"},"roomId":{"type":"string"},"runId":{"type":"string"},"text":{"type":"string"}},"required":["type","workspaceId","roomId","runId","text"]},{"type":"object","properties":{"type":{"type":"string","const":"assistant.done"},"workspaceId":{"type":"string"},"roomId":{"type":"string"},"runId":{"type":"string"}},"required":["type","workspaceId","roomId","runId"]},{"type":"object","properties":{"type":{"type":"string","const":"task.updated"},"workspaceId":{"type":"string"},"roomId":{"type":"string"},"taskId":{"type":"string"}},"required":["type","workspaceId","roomId","taskId"]},{"type":"object","properties":{"type":{"type":"string","const":"report.changed"},"workspaceId":{"type":"string"},"reportId":{"type":"string"}},"required":["type","workspaceId","reportId"]}]},"McpResponse":{"anyOf":[{"$ref":"#/components/schemas/McpResult"},{"$ref":"#/components/schemas/McpError"}]},"OAuthProtocolError":{"type":"object","properties":{"error":{"type":"string","description":"The code from the RFC, such as invalid_grant."},"error_description":{"type":"string","description":"Written for a person."}},"required":["error","error_description"]},"OAuthToken":{"type":"object","properties":{"access_token":{"type":"string","description":"Starts pta_. Send it as `Authorization: Bearer`."},"token_type":{"type":"string","const":"Bearer"},"expires_in":{"type":"number","description":"Seconds."},"refresh_token":{"type":"string","description":"Starts ptr_."},"scope":{"type":"string","description":"What the token holds, separated by spaces."}},"required":["access_token","token_type","expires_in","refresh_token","scope"]},"OAuthRegisteredClient":{"type":"object","properties":{"client_id":{"type":"string"},"client_id_issued_at":{"type":"number","description":"Unix seconds."},"client_secret":{"description":"Only for a client that said it can keep one, and only in this response.","type":"string"},"client_secret_expires_at":{"description":"0: it does not expire.","type":"number"},"client_name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}},"grant_types":{"type":"array","items":{"type":"string"}},"response_types":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_method":{"type":"string"},"application_type":{"type":"string","enum":["web","native"]},"client_uri":{"type":"string"},"logo_uri":{"type":"string"},"scope":{"type":"string"}},"required":["client_id","client_id_issued_at","client_name","redirect_uris","grant_types","response_types","token_endpoint_auth_method"]},"OAuthServerMetadata":{"type":"object","properties":{"issuer":{"type":"string"},"authorization_endpoint":{"type":"string"},"token_endpoint":{"type":"string"},"revocation_endpoint":{"type":"string"},"registration_endpoint":{"type":"string"},"service_documentation":{"type":"string"},"scopes_supported":{"type":"array","items":{"type":"string"}},"response_types_supported":{"type":"array","items":{"type":"string"}},"response_modes_supported":{"type":"array","items":{"type":"string"}},"grant_types_supported":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_methods_supported":{"type":"array","items":{"type":"string"}},"revocation_endpoint_auth_methods_supported":{"type":"array","items":{"type":"string"}},"code_challenge_methods_supported":{"type":"array","items":{"type":"string"}},"client_id_metadata_document_supported":{"type":"boolean"},"authorization_response_iss_parameter_supported":{"type":"boolean"}},"required":["issuer","authorization_endpoint","token_endpoint","revocation_endpoint","registration_endpoint","service_documentation","scopes_supported","response_types_supported","response_modes_supported","grant_types_supported","token_endpoint_auth_methods_supported","revocation_endpoint_auth_methods_supported","code_challenge_methods_supported","client_id_metadata_document_supported","authorization_response_iss_parameter_supported"]},"OAuthProtectedResource":{"type":"object","properties":{"resource":{"type":"string"},"authorization_servers":{"type":"array","items":{"type":"string"}},"scopes_supported":{"type":"array","items":{"type":"string"}},"bearer_methods_supported":{"type":"array","items":{"type":"string"}},"resource_name":{"type":"string"},"resource_documentation":{"type":"string"},"resource_metadata":{"type":"string"}},"required":["resource","authorization_servers","scopes_supported","bearer_methods_supported","resource_name","resource_documentation"]},"Blueprint":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","description":"What blueprint_name takes."},"title":{"type":"string"},"description":{"type":["string","null"]},"documentType":{"$ref":"#/components/schemas/DocumentType"},"builtIn":{"type":"boolean","description":"Ships with PaperTotal, and can be used and not changed."},"version":{"type":"number","description":"Changing a blueprint adds a version, and results keep the one that made them."},"schema":{"type":"object","properties":{"type":{"type":"string","const":"object"},"description":{"type":"string","maxLength":300},"properties":{"$ref":"#/components/schemas/SharedSchema0"}},"required":["type","properties"],"additionalProperties":false},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":100},"example":{"type":"string","maxLength":200},"box":{"type":"object","properties":{"page":{"type":"integer","minimum":0,"maximum":49},"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1},"width":{"type":"number","minimum":0,"maximum":1},"height":{"type":"number","minimum":0,"maximum":1}},"required":["page","x","y","width","height"],"additionalProperties":false}},"required":["path"],"additionalProperties":false}},"createdAt":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["id","name","title","description","documentType","builtIn","version","schema","fields","createdAt","updatedAt"]},"BlueprintList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BlueprintSummary"}},"nextCursor":{"type":"null"}},"required":["data","nextCursor"]},"BlueprintDraft":{"type":"object","properties":{"documentId":{"type":"string"},"status":{"type":"string","enum":["READING","READY","FAILED"]},"draft":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"title":{"type":"string"},"documentType":{"$ref":"#/components/schemas/DocumentType"},"schema":{"type":"object","properties":{"type":{"type":"string","const":"object"},"description":{"type":"string","maxLength":300},"properties":{"$ref":"#/components/schemas/SharedSchema0"}},"required":["type","properties"],"additionalProperties":false},"fields":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","maxLength":100},"example":{"type":"string","maxLength":200},"box":{"type":"object","properties":{"page":{"type":"integer","minimum":0,"maximum":49},"x":{"type":"number","minimum":0,"maximum":1},"y":{"type":"number","minimum":0,"maximum":1},"width":{"type":"number","minimum":0,"maximum":1},"height":{"type":"number","minimum":0,"maximum":1}},"required":["page","x","y","width","height"],"additionalProperties":false}},"required":["path"],"additionalProperties":false}},"engine":{"type":"string","enum":["rules","claude"]}},"required":["name","title","documentType","schema","fields","engine"]},{"type":"null"}],"description":"A starting point. Nothing is saved until it is sent to POST /v1/blueprints."},"error":{"type":["string","null"]}},"required":["documentId","status","draft","error"]},"Classification":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/DocumentStatus"},"document_type":{"anyOf":[{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},{"type":"null"}],"description":"Null until it has been read."},"engine":{"anyOf":[{"type":"string","enum":["rules","claude"]},{"type":"null"}]},"scores":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},"description":"The runners-up, best first."}},"required":["id","status","document_type","engine","scores"]},"Extraction":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/DocumentStatus"},"document_type":{"anyOf":[{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},{"type":"null"}],"description":"Null until it has been read."},"engine":{"anyOf":[{"type":"string","enum":["rules","claude"]},{"type":"null"}]},"scores":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},"description":"The runners-up, best first."},"extraction":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"extraction_error":{"type":["string","null"]},"document":{"$ref":"#/components/schemas/Document"}},"required":["id","status","document_type","engine","scores","extraction","extraction_error","document"]},"DocumentSet":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["ZIP","BATCH","SPLIT","DOCUMENTS","W2","BANK_STATEMENT","PARSE"]},"status":{"type":"string","enum":["QUEUED","PROCESSING","COMPLETED","FAILED"]},"originalFilename":{"type":["string","null"]},"pageCount":{"type":"number"},"ranges":{"type":"array","items":{"type":"object","properties":{"start":{"type":"number"},"end":{"type":"number"},"type":{"type":"string"},"score":{"type":"number"}},"required":["start","end"]},"description":"Pages found, 1-based and inclusive, with a type and score when classified."},"refused":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":"string"}},"required":["name","reason"]}},"error":{"type":["string","null"]},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/DocumentType"},"status":{"$ref":"#/components/schemas/DocumentStatus"},"pageStart":{"type":["number","null"]},"pageEnd":{"type":["number","null"]}},"required":["id","type","status","pageStart","pageEnd"]}},"createdAt":{"type":"string"},"completedAt":{"type":["string","null"]}},"required":["id","kind","status","originalFilename","pageCount","ranges","refused","error","documents","createdAt","completedAt"]},"DocumentSetPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DocumentSet"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ParsedDocument":{"type":"object","properties":{"id":{"type":"string"},"status":{"$ref":"#/components/schemas/DocumentStatus"},"markdown":{"type":["string","null"]},"meta":{"anyOf":[{"type":"object","properties":{"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"width":{"type":"number"},"height":{"type":"number"},"blurScore":{"description":"Sharpness of a photographed page. Higher is sharper.","type":["number","null"]},"ocrScore":{"type":["number","null"]}},"required":["index","width","height","blurScore","ocrScore"]}},"ocrScore":{"type":["number","null"]},"engine":{"type":"string","enum":["rules","claude"]}},"required":["pages","ocrScore","engine"]},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"title":{"type":["string","null"]},"notes":{"type":["string","null"]},"externalId":{"type":["string","null"]},"setId":{"type":["string","null"]},"createdAt":{"type":"string"},"boxes":{"description":"With details: every recognized line and where it sits.","type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"confidence":{"type":"number"},"page":{"type":"number"},"box":{"anyOf":[{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4},{"type":"null"}]}},"required":["text","confidence","page","box"]}}},"required":["id","status","markdown","meta","tags","title","notes","externalId","setId","createdAt"]},"ParsedDocumentPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ParsedDocument"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"DocumentUpload":{"type":"object","properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/DocumentType"},"source":{"$ref":"#/components/schemas/DocumentSource"},"status":{"type":"string"},"originalFilename":{"type":["string","null"]},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"},"pageCount":{"type":"number"},"externalId":{"type":["string","null"]},"folderId":{"type":["string","null"]},"expenseId":{"type":["string","null"]},"mailInBatchId":{"type":["string","null"]},"title":{"type":["string","null"]},"notes":{"type":["string","null"]},"latitude":{"description":"Where the device said it was when the photo was taken.","type":["number","null"]},"longitude":{"type":["number","null"]},"locationAccuracyM":{"type":["number","null"]},"duplicateOfId":{"type":["string","null"]},"processingError":{"type":["string","null"]},"processingErrorCode":{"anyOf":[{"type":"string","enum":["FILE_ENCRYPTED"]},{"type":"null"}],"description":"Set when the failure is one the file's owner can fix. processingError says what to do."},"verification":{"type":"string"},"capturedAt":{"type":["string","null"]},"processedAt":{"type":["string","null"]},"viewedAt":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"uploadedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"url":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all."},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}],"description":"Null when the page is not one, and for a caller without expenses.read_all."},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all. Value null means nothing could say."},"language":{"type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]}},"ocrScore":{"type":["number","null"]},"isFront":{"description":"A check: the front or the back.","type":["boolean","null"]},"tiffRejectScore":{"description":"A check: 0 is a clean clearing image and 1 is one a bank would send back.","type":["number","null"]},"tiffUpscaled":{"description":"A check: the photo was under 240 DPI, so the clearing image was enlarged.","type":["boolean","null"]}},"required":["index","url","thumbnailUrl","width","height","isBlurry","glare","isLcd","screenshot","aiGenerated","language","languages","ocrScore","isFront","tiffRejectScore","tiffUpscaled"]}},"classification":{"anyOf":[{"type":"object","properties":{"value":{"type":"string","description":"A document class, or one of the labels the caller named."},"score":{"type":"number","description":"0..1."},"engine":{"type":"string","enum":["rules","claude"]},"scores":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},"description":"The runners-up, best first."}},"required":["value","score","engine","scores"]},{"type":"null"}],"description":"What the classifier decided, when it was asked."},"blueprint":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"description":"Null for a built-in, which has no versions.","type":["number","null"]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"The fields the blueprint defines. Null when the run failed."},"offsets":{"description":"Where each value sits in the text, for a blueprint that asks.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"begin":{"type":"number"},"end":{"type":"number"}},"required":["begin","end"]}},"unmatched":{"description":"Fields where a value was read and did not fit, such as words where a number belongs or a choice off the list. Each is left empty. An empty field not named here was not on the document.","type":"array","items":{"type":"string"}},"error":{"description":"Why the run gave nothing back.","type":["string","null"]}},"required":["name","version","result","error"]},{"type":"null"}],"description":"The blueprint this was read with, and what came out of it."},"tags":{"type":"array","items":{"type":"string"}},"tagRefs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"The same tags with their ids, which a tag route takes."},"recordStatus":{"anyOf":[{"type":"string","enum":["processed","reviewed","archived"]},{"type":"null"}],"description":"Where a read document stands: reviewedAt and archivedAt in one word. Null until it has been read."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."},"setId":{"description":"The upload this came out of: a ZIP, a split PDF or a batch of addresses.","type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"type":"null"}],"description":"Values the workspace custom field rules read out of the text."},"enrichment":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","DONE","FAILED"]},"steps":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"failed":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}}},"required":["status","steps","failed"]},{"type":"null"}],"description":"Work still running after the first answer."},"extraction":{"anyOf":[{"type":"object","properties":{"fields":{"type":"object","properties":{"documentType":{"default":"RECEIPT","$ref":"#/components/schemas/DocumentType"},"merchantName":{"type":["string","null"]},"merchantAddress":{"type":["string","null"]},"merchantPhone":{"type":["string","null"]},"merchantWebsite":{"type":["string","null"]},"merchantTaxId":{"type":["string","null"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"time":{"type":["string","null"]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHF","CLP","CNY","COP","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","UYU","UZS","VES","VND","VUV","WST","XAF","XCD","XCG","XOF","XPF","YER","ZAR","ZMW","ZWG","CUC","HRK","SLL","ZWL","XDR","XSU"]},{"type":"null"}]},"currencyGuessed":{"default":false,"type":"boolean"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxLines":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"ratePct":{"type":["number","null"]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"baseMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"code":{"type":["string","null"]},"totalInclusive":{"type":["boolean","null"]}},"required":["amountMinor"]}},"tipMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"shippingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"paymentType":{"anyOf":[{"$ref":"#/components/schemas/PaymentType"},{"type":"null"}]},"cardBrand":{"type":["string","null"]},"cardLast4":{"type":["string","null"]},"receiptNumber":{"type":["string","null"]},"invoiceNumber":{"type":["string","null"]},"poNumber":{"type":["string","null"]},"lineItems":{"default":[],"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"id":{"type":["string","null"]},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"text":{"type":["string","null"]},"type":{"anyOf":[{"$ref":"#/components/schemas/LineItemType"},{"type":"null"}]},"fullDescription":{"type":["string","null"]},"normalizedDescription":{"type":["string","null"]},"section":{"type":["string","null"]},"reference":{"type":["string","null"]},"upc":{"type":["string","null"]},"hsn":{"type":["string","null"]},"lot":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unitOfMeasure":{"type":["string","null"]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountRatePct":{"type":["number","null"]},"discountPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxRatePct":{"type":["number","null"]},"taxCode":{"type":["string","null"]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"grossTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"netTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"category":{"type":["string","null"]},"customCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"countryOfOrigin":{"type":["string","null"]},"manufacturer":{"type":["string","null"]},"weight":{"type":["string","null"]},"brand":{"type":["string","null"]},"hsaFsaEligible":{"type":["boolean","null"]},"productInfo":{"anyOf":[{"type":"object","properties":{"expandedDescription":{"type":["string","null"]},"brand":{"type":["string","null"]},"categoryPath":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}}},{"type":"null"}]}},"required":["description","amountMinor"]}},"suggestedCategory":{"type":["string","null"]},"documentTitle":{"type":["string","null"]},"documentReferenceNumber":{"type":["string","null"]},"isDocument":{"type":["boolean","null"]},"isTransaction":{"type":["boolean","null"]},"isMoneyIn":{"type":["boolean","null"]},"accountingEntryType":{"anyOf":[{"type":"string","enum":["debit","credit"]},{"type":"null"}]},"vendor":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"vendors":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}}},{"type":"null"}]},"bankBreakdown":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}}},{"type":"null"}]},"billTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"vatNumber":{"type":["string","null"]},"regNumber":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"email":{"type":["string","null"]}}},{"type":"null"}]},"shipTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"insuranceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cashbackMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"roundingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"finalBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"previousBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"totalQuantity":{"type":["number","null"]},"totalWeight":{"type":["string","null"]},"payment":{"anyOf":[{"type":"object","properties":{"cardNumber":{"type":["string","null"]},"displayName":{"type":["string","null"]},"terms":{"type":["string","null"]},"type":{"anyOf":[{"$ref":"#/components/schemas/PaymentMethod"},{"type":"null"}]}}},{"type":"null"}]},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"shipDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"deliveryDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"exchangeRate":{"type":["number","null"]},"countryCode":{"type":["string","null"]},"deliveryNoteNumber":{"type":["string","null"]},"trackingNumber":{"type":["string","null"]},"trackingNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"incoterms":{"type":["string","null"]},"weights":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"licensePlateNumber":{"type":["string","null"]},"vinNumber":{"type":["string","null"]},"guestCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"serverName":{"type":["string","null"]},"storeNumber":{"type":["string","null"]},"vendingPerson":{"type":["string","null"]},"vendingPersonNumber":{"type":["string","null"]},"customerAccountNumber":{"type":["string","null"]},"category":{"type":["string","null"]},"defaultCategory":{"type":["string","null"]},"barcodes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"data":{"type":"string"},"type":{"$ref":"#/components/schemas/BarcodeType"},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"boundingRegion":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]}},"required":["data","type","page"]}},{"type":"null"}]},"paymentLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"source":{"type":"string","enum":["text","hyperlink","qr_code","barcode"]}},"required":["url","source"]}},{"type":"null"}]},"folio":{"anyOf":[{"type":"object","properties":{"arrivalDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"departureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roomNumber":{"type":["string","null"]},"guestName":{"type":["string","null"]},"nights":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"confirmationNumber":{"type":["string","null"]}}},{"type":"null"}]},"enrichedFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"check":{"anyOf":[{"type":"object","properties":{"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountText":{"type":["string","null"]},"amountsAgree":{"type":["boolean","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"checkNumber":{"type":["string","null"]},"checkType":{"anyOf":[{"$ref":"#/components/schemas/CheckType"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"memo":{"type":["string","null"]},"payerName":{"type":["string","null"]},"payerAddress":{"type":["string","null"]},"receiverName":{"type":["string","null"]},"receiverAddress":{"type":["string","null"]},"isSigned":{"type":["boolean","null"]},"endorsement":{"anyOf":[{"type":"object","properties":{"isEndorsed":{"type":["boolean","null"]},"isSigned":{"type":["boolean","null"]},"mobileOrRemoteDeposit":{"anyOf":[{"type":"object","properties":{"checkbox":{"type":["boolean","null"]},"instructions":{"type":["boolean","null"]}}},{"type":"null"}]},"isMobileOrRemoteDepositOnly":{"type":["boolean","null"]}}},{"type":"null"}]},"micr":{"anyOf":[{"type":"object","properties":{"routingNumber":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"serialNumber":{"type":["string","null"]},"raw":{"type":["string","null"]},"branch":{"type":["string","null"]},"institution":{"type":["string","null"]},"transactionCode":{"type":["string","null"]}}},{"type":"null"}]},"fractionalRoutingNumber":{"type":["string","null"]},"routingFromFractional":{"type":["string","null"]},"voidTerms":{"type":["string","null"]}}},{"type":"null"}]},"statement":{"anyOf":[{"type":"object","properties":{"accountHolderName":{"type":["string","null"]},"accountHolderAddress":{"type":["string","null"]},"accountType":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"bankWebsite":{"type":["string","null"]},"bankVatNumber":{"type":["string","null"]},"accountVatNumber":{"type":["string","null"]},"periodStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"periodEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementNumber":{"type":["string","null"]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"minimumDueMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"routingNumber":{"type":["string","null"]},"swift":{"type":["string","null"]},"iban":{"type":["string","null"]},"accounts":{"default":[],"type":"array","items":{"type":"object","properties":{"number":{"type":["string","null"]},"ibanNumber":{"type":["string","null"]},"accountType":{"type":["string","null"]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"summaries":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["name"]}},"transactions":{"default":[],"type":"array","items":{"type":"object","properties":{"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"postedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"vendor":{"type":["string","null"]},"transactionId":{"type":["string","null"]},"debitAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"creditAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cardNumber":{"type":["string","null"]},"text":{"type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"page":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["order"]}}}}},"balancesAgree":{"type":["boolean","null"]}}},{"type":"null"}]},"taxForm":{"anyOf":[{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/TaxFormKind"},"w2":{"anyOf":[{"type":"object","properties":{"employeeSsn":{"type":["string","null"]},"ein":{"type":["string","null"]},"employerName":{"type":["string","null"]},"employerAddress":{"type":["string","null"]},"controlNumber":{"type":["string","null"]},"employeeName":{"type":["string","null"]},"employeeAddress":{"type":["string","null"]},"wagesOtherComps":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"federalIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"allocatedTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"advanceEicPayment":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dependentCareBenefits":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"nonQualifiedPlans":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"box12":{"default":[],"type":"array","items":{"type":"object","properties":{"box":{"type":"string"},"code":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["box","code"]}},"is13a":{"type":["boolean","null"]},"is13b":{"type":["boolean","null"]},"is13c":{"type":["boolean","null"]},"box14Other":{"default":[],"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["label"]}},"stateLines":{"default":[],"type":"array","items":{"type":"object","properties":{"state":{"type":["string","null"]},"employerStateId":{"type":["string","null"]},"stateWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"stateIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localityName":{"type":["string","null"]}}}},"taxYear":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}}},{"type":"null"}]},"w9":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"businessName":{"type":["string","null"]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"individual":{"type":["boolean","null"]},"cCorp":{"type":["boolean","null"]},"sCorp":{"type":["boolean","null"]},"partnership":{"type":["boolean","null"]},"trustEstate":{"type":["boolean","null"]},"llc":{"type":["boolean","null"]},"llcType":{"type":["string","null"]},"other":{"type":["boolean","null"]},"otherDescription":{"type":["string","null"]},"exemptPayeeCode":{"type":["string","null"]},"exemption":{"type":["string","null"]},"ssn":{"type":["string","null"]},"ein":{"type":["string","null"]},"accountNumbers":{"type":["string","null"]},"requester":{"type":["string","null"]},"signature":{"type":["boolean","null"]},"signatureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}}},{"type":"null"}]},"w8BenE":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","boolean","null"]}},{"type":"null"}]}},"required":["kind"]},{"type":"null"}]},"itinerary":{"anyOf":[{"type":"object","properties":{"travelerName":{"type":["string","null"]},"bookingReference":{"type":["string","null"]},"origin":{"type":["string","null"]},"destination":{"type":["string","null"]},"departsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"returnsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"segments":{"default":[],"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["flight","hotel","car","rail","other"]},"carrier":{"type":["string","null"]},"number":{"type":["string","null"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"departsAt":{"type":["string","null"]},"arrivesAt":{"type":["string","null"]},"confirmationNumber":{"type":["string","null"]},"seat":{"type":["string","null"]}},"required":["kind"]}}}},{"type":"null"}]},"fieldConfidence":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fieldBoxes":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"page":{"type":"number"},"box":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4}},"required":["page","box"]}}},"description":"What was read, as the extraction contract types it. fieldConfidence holds per-field confidence, 0..1."},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/IntegrityWarning"},"message":{"type":"string"},"page":{"type":["number","null"]}},"required":["code","message"]},"description":"Integrity findings. A caller without expenses.read_all sees the arithmetic and dates only."}},"required":["fields","confidence","flags","warnings"]},{"type":"null"}]},"fraud":{"anyOf":[{"$ref":"#/components/schemas/DocumentFraud"},{"type":"null"}]},"sealed":{"type":"array","items":{"$ref":"#/components/schemas/SealedValue"},"description":"Bank and tax numbers read from this document, as masks. POST /v1/documents/{id}/reveal opens them."},"updatedAt":{"type":"string"},"extractor":{"description":"What read it: rules, claude, a blueprint, business-card, or none.","type":["string","null"]},"ocrText":{"description":"Everything read off the page. Card, bank and tax numbers are masked.","type":["string","null"]},"pdfUrl":{"description":"The PDF as uploaded, signed for 15 minutes. Null for an image, and for a PDF that prints a number only a reveal hands out.","type":["string","null"]},"meta":{"$ref":"#/components/schemas/DocumentMeta"},"reviewedAt":{"description":"A person checked what was read.","type":["string","null"]},"approvedAt":{"description":"A developer's own approved flag. An expense's approval is a different thing.","type":["string","null"]},"object":{"description":"Set on the answer to a ZIP, which holds kind, documentIds and refused instead of a document.","type":"string","const":"document_set"},"kind":{"type":"string"},"documentIds":{"type":"array","items":{"type":"string"}},"refused":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":"string"}},"required":["name","reason"]}}},"required":["id","status"]},"InboundEmailPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InboundEmail"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ExpenseDuplicateGroup":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseDetail"}},"hidden":{"type":"number","description":"Copies in the group the caller cannot read."}},"required":["data","hidden"]},"Workflow":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"version":{"description":"The version that runs. Null until it has been turned on once.","type":["number","null"]},"steps":{"type":"number"},"lastRunAt":{"type":["string","null"]},"lastRunStatus":{"anyOf":[{"type":"string","enum":["RUNNING","PAUSED","COMPLETED","FAILED","CANCELLED"]},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"graph":{"type":"object","properties":{"nodes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"},"type":{"type":"string","enum":["api_import","document_aggregator","google_drive_import","gmail_input","dropbox_import","email_collector","ai_agent","convert_csv","convert_excel","decision","document_classifier","email_approval","extract_data","extract_data_set","pdf_splitter","split_collector","business_insights","email_file","google_drive","dropbox","google_sheets","xero_export"]},"x":{"type":"number","minimum":-100000,"maximum":100000},"y":{"type":"number","minimum":-100000,"maximum":100000},"config":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","x","y"]}},"edges":{"maxItems":300,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"},"from":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"},"port":{"type":"string","minLength":1,"maxLength":80},"to":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[\\w-]+$"}},"required":["id","from","port","to"]}}},"required":["nodes","edges"]},"edited":{"type":"boolean","description":"What is on the canvas differs from the version that runs."},"triggers":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowTrigger"}},"enabledAt":{"type":["string","null"]}},"required":["id","name","enabled","version","steps","lastRunAt","lastRunStatus","createdAt","updatedAt","graph","edited","triggers","enabledAt"]},"WorkflowPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowSummary"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"WorkflowValidation":{"type":"object","properties":{"ok":{"type":"boolean"},"issues":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowIssue"},"description":"Any of these stops it being turned on."},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowIssue"},"description":"None of these stops it. A person should know before it runs."}},"required":["ok","issues","warnings"]},"WorkflowRun":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"version":{"type":"number"},"status":{"type":"string","enum":["RUNNING","PAUSED","COMPLETED","FAILED","CANCELLED"]},"trigger":{"type":"string","enum":["API","MANUAL","SCHEDULE","GMAIL","GOOGLE_DRIVE","DROPBOX","EMAIL"]},"startNodeId":{"type":"string"},"documents":{"type":"number"},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]},"steps":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowStep"}}},"required":["id","workflowId","version","status","trigger","startNodeId","documents","error","createdAt","finishedAt","steps"]},"WorkflowRunSummary":{"type":"object","properties":{"id":{"type":"string"},"workflowId":{"type":"string"},"version":{"type":"number"},"status":{"type":"string","enum":["RUNNING","PAUSED","COMPLETED","FAILED","CANCELLED"]},"trigger":{"type":"string","enum":["API","MANUAL","SCHEDULE","GMAIL","GOOGLE_DRIVE","DROPBOX","EMAIL"]},"startNodeId":{"type":"string"},"documents":{"type":"number"},"error":{"type":["string","null"]},"createdAt":{"type":"string"},"finishedAt":{"type":["string","null"]}},"required":["id","workflowId","version","status","trigger","startNodeId","documents","error","createdAt","finishedAt"]},"WorkflowRunPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowRunSummary"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"WorkflowApprovalLink":{"type":"object","properties":{"workflow":{"type":"string"},"workspace":{"type":"string"},"decision":{"type":"string","enum":["approve","reject"],"description":"What this link was sent to do. Nothing happens until it is posted back."},"otherToken":{"type":"string"},"email":{"type":"string"},"message":{"type":["string","null"]},"state":{"type":"string","enum":["OPEN","ANSWERED","CLOSED"]},"answered":{"anyOf":[{"type":"object","properties":{"decision":{"type":"string","enum":["approve","reject"]},"by":{"type":"string"},"at":{"type":"string"}},"required":["decision","by","at"]},{"type":"null"}]},"expiresAt":{"type":"string"},"documents":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowApprovalDocument"}},"files":{"type":"array","items":{"type":"string"}}},"required":["workflow","workspace","decision","otherToken","email","message","state","answered","expiresAt","documents","files"]},"WorkflowApprovalAnswer":{"type":"object","properties":{"applied":{"type":"boolean","description":"False when someone had already answered, or the run has moved on. Nothing changed then."},"decision":{"anyOf":[{"type":"string","enum":["approve","reject"]},{"type":"null"}]},"state":{"type":"string","enum":["ANSWERED","CLOSED"]}},"required":["applied","decision","state"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Stable. Safe to branch on."},"message":{"type":"string","description":"Written for a person."},"details":{},"requestId":{"description":"Quote this when you contact support.","type":"string"}},"required":["code","message"]}},"required":["error"]},"Attachment":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string"},"sizeBytes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"url":{"type":"string","description":"A signed link that lasts 15 minutes."}},"required":["id","filename","contentType","sizeBytes","url"]},"UploadTicket":{"type":"object","properties":{"uploadId":{"type":"string"},"method":{"type":"string","const":"PUT"},"url":{"type":"string","description":"Send exactly sizeBytes bytes here, with these headers. It goes straight to storage."},"headers":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"},"description":"The signature covers these, so send them exactly."},"expiresAt":{"type":"string","description":"When the URL stops working. If a PUT fails, ask for a new ticket and try once more."}},"required":["uploadId","method","url","headers","expiresAt"]},"AnalyticsSummary":{"type":"object","properties":{"totalMinor":{"type":"number"},"count":{"type":"number"},"averageMinor":{"type":"number"},"unconverted":{"type":"number","description":"Expenses with no exchange rate yet. They are not in these totals."},"reimbursableMinor":{"type":"number"},"billableMinor":{"type":"number"},"previous":{"type":"object","properties":{"totalMinor":{"type":"number"},"count":{"type":"number"},"averageMinor":{"type":"number"}},"required":["totalMinor","count","averageMinor"]},"changePct":{"type":["number","null"]},"from":{"type":"string"},"to":{"type":"string"},"previousFrom":{"type":"string"},"previousTo":{"type":"string"},"currency":{"type":"string","description":"Every amount here is in this currency: the workspace's base, or the one `groupCurrency` asked for."},"convertedFrom":{"description":"Set when `groupCurrency` converted the amounts: the currency they were in, at the latest rate.","type":["string","null"]}},"required":["totalMinor","count","averageMinor","unconverted","reimbursableMinor","billableMinor","previous","changePct","from","to","previousFrom","previousTo","currency","convertedFrom"]},"Breakdown":{"type":"object","properties":{"dimension":{"type":"string","enum":["merchant","category","project","member","tag","department"]},"totalMinor":{"type":"number"},"previousTotalMinor":{"type":"number"},"averageMinor":{"type":"number","description":"What one row spends on average in this period, over every row and not only those within `limit`."},"rows":{"type":"array","items":{"$ref":"#/components/schemas/BreakdownRow"}},"other":{"anyOf":[{"type":"object","properties":{"totalMinor":{"type":"number"},"count":{"type":"number"},"previousMinor":{"type":"number"}},"required":["totalMinor","count","previousMinor"]},{"type":"null"}],"description":"Everything past `limit`. Null when every row fits."},"overlapping":{"type":"boolean","description":"True for tags: one expense can carry several, so rows can add up to more than the total."},"from":{"type":"string"},"to":{"type":"string"},"previousFrom":{"type":"string"},"previousTo":{"type":"string"},"currency":{"type":"string","description":"Every amount here is in this currency: the workspace's base, or the one `groupCurrency` asked for."},"convertedFrom":{"description":"Set when `groupCurrency` converted the amounts: the currency they were in, at the latest rate.","type":["string","null"]}},"required":["dimension","totalMinor","previousTotalMinor","averageMinor","rows","other","overlapping","from","to","previousFrom","previousTo","currency","convertedFrom"]},"Trend":{"type":"object","properties":{"interval":{"$ref":"#/components/schemas/TrendInterval"},"points":{"type":"array","items":{"$ref":"#/components/schemas/TrendPoint"}},"totalMinor":{"type":"number"},"count":{"type":"number"},"averageMinor":{"type":"number","description":"What one point spends on average. For a running total, what each step adds on average."},"from":{"type":"string"},"to":{"type":"string"},"previousFrom":{"type":"string"},"previousTo":{"type":"string"},"currency":{"type":"string","description":"Every amount here is in this currency: the workspace's base, or the one `groupCurrency` asked for."},"convertedFrom":{"description":"Set when `groupCurrency` converted the amounts: the currency they were in, at the latest rate.","type":["string","null"]}},"required":["interval","points","totalMinor","count","averageMinor","from","to","previousFrom","previousTo","currency","convertedFrom"]},"Budget":{"type":"object","properties":{"id":{"type":"string"},"scope":{"$ref":"#/components/schemas/BudgetScope"},"targetId":{"type":"string"},"targetName":{"type":"string"},"period":{"$ref":"#/components/schemas/BillingInterval"},"periodKey":{"type":"string","description":"2026-03 for a month, 2026 for a fiscal year."},"periodStart":{"type":"string"},"periodEnd":{"type":"string"},"currency":{"type":"string"},"totalMinor":{"type":["number","null"]},"perMemberMinor":{"type":["number","null"]},"thresholds":{"type":"array","items":{"type":"number"}},"total":{"anyOf":[{"$ref":"#/components/schemas/BudgetStanding"},{"type":"null"}],"description":"Everyone together. Null when the budget has no shared limit."},"mine":{"anyOf":[{"$ref":"#/components/schemas/BudgetStanding"},{"type":"null"}],"description":"The caller's own share. Null when they have no limit of their own here."}},"required":["id","scope","targetId","targetName","period","periodKey","periodStart","periodEnd","currency","totalMinor","perMemberMinor","thresholds","total","mine"]},"BudgetPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Budget"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"BulkDocumentResult":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"number","description":"Not found, not the caller's to change, or backing an expense on a submitted report."},"nextCursor":{"description":"With a filter: send this back as cursor until it is null.","type":["string","null"]}},"required":["updated","skipped"]},"DocumentCount":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]},"TrashActionResult":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"number"},"more":{"type":"boolean","description":"With all: there is more to do. Call again."}},"required":["updated","skipped","more"]},"TrashedDocumentPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TrashedDocument"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"BulkExpenseResult":{"type":"object","properties":{"updated":{"type":"number"},"skipped":{"type":"number"}},"required":["updated","skipped"]},"BulkReportResult":{"type":"object","properties":{"succeeded":{"type":"array","items":{"type":"string"}},"failed":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":["string","null"]},"code":{"type":"string"},"message":{"type":"string"}},"required":["id","reference","code","message"]}}},"required":["succeeded","failed"]},"CatalogImportResult":{"type":"object","properties":{"created":{"type":"number"},"updated":{"type":"number"},"skipped":{"type":"number","description":"Rows that matched an existing record and changed nothing, or repeated an earlier row."},"errors":{"type":"array","items":{"type":"object","properties":{"line":{"type":"number"},"message":{"type":"string"}},"required":["line","message"]},"description":"Rows that could not be used. `line` counts from 1 and includes the header."},"removed":{"description":"A replace: categories the file left out and nothing used, now deleted.","type":"number"},"disabled":{"description":"A replace: categories the file left out that something still uses, now turned off.","type":"number"}},"required":["created","updated","skipped","errors"]},"Category":{"type":"object","properties":{"id":{"type":"string"},"parentId":{"type":["string","null"]},"name":{"type":"string"},"glCode":{"type":["string","null"]},"taxLine":{"type":["string","null"]},"origin":{"type":"string","enum":["SYSTEM","CUSTOM","ACCOUNTING"],"description":"Where it came from: the workspace template, a person, or an import from the connected books."},"deductiblePct":{"type":"number"},"headerOnly":{"type":"boolean","description":"A heading over its subcategories. It groups the list and cannot be chosen on an expense."},"enabled":{"type":"boolean"},"system":{"type":"boolean"},"position":{"type":"number"},"expenseCount":{"type":"number","description":"A category on any expense cannot be deleted, only disabled."},"type":{"$ref":"#/components/schemas/CategoryType"},"payrollCode":{"description":"Null unless the caller manages settings or exports: payroll codes are not for everyone.","type":["string","null"]},"descriptionHint":{"description":"Shown under the description while someone fills in an expense.","type":["string","null"]},"approverId":{"description":"Sees any report carrying this category before the usual approvers.","type":["string","null"]},"approverName":{"type":["string","null"]},"commentRequired":{"type":"boolean","description":"An expense here needs a description, or it carries a finding on its report."},"maxExpenseMinor":{"description":"An expense here over this, in the workspace's currency, carries a finding on its report.","type":["number","null"]}},"required":["id","parentId","name","glCode","taxLine","origin","deductiblePct","headerOnly","enabled","system","position","expenseCount","type","payrollCode","descriptionHint","approverId","approverName","commentRequired","maxExpenseMinor"]},"CategoryPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Comment":{"type":"object","properties":{"id":{"type":"string"},"body":{"type":"string"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}},"editedAt":{"type":["string","null"]},"author":{"$ref":"#/components/schemas/ReportPerson"},"system":{"description":"PaperTotal wrote this, about something that happened to the report.","type":"boolean"},"actedBy":{"anyOf":[{"$ref":"#/components/schemas/ReportPerson"},{"type":"null"}],"description":"The delegate who really wrote it, when that was not the author."},"mentions":{"type":"array","items":{"$ref":"#/components/schemas/ReportPerson"}},"createdAt":{"type":"string"}},"required":["id","body","attachments","editedAt","author","actedBy","mentions","createdAt"]},"CommentPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"CreatedId":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"PostedComment":{"type":"object","properties":{"id":{"type":"string"},"body":{"type":"string"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Attachment"}},"editedAt":{"type":["string","null"]},"author":{"$ref":"#/components/schemas/ReportPerson"},"system":{"description":"PaperTotal wrote this, about something that happened to the report.","type":"boolean"},"actedBy":{"anyOf":[{"$ref":"#/components/schemas/ReportPerson"},{"type":"null"}],"description":"The delegate who really wrote it, when that was not the author."},"mentions":{"type":"array","items":{"$ref":"#/components/schemas/ReportPerson"}},"createdAt":{"type":"string"},"unreachable":{"type":"array","items":{"$ref":"#/components/schemas/ReportPerson"},"description":"Members the comment named who cannot read this, so were not mentioned or told."}},"required":["id","body","attachments","editedAt","author","actedBy","mentions","createdAt","unreachable"]},"MentionablePeople":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReportPerson"}}},"required":["data"]},"Contact":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","description":"Always something to show: the name, else the company, else the first address or number."},"firstName":{"type":["string","null"]},"lastName":{"type":["string","null"]},"company":{"type":["string","null"]},"title":{"type":["string","null"]},"emails":{"type":"array","items":{"type":"string"}},"phones":{"type":"array","items":{"type":"string"}},"mobile":{"type":["string","null"]},"fax":{"type":["string","null"]},"website":{"type":["string","null"]},"address":{"type":["string","null"]},"city":{"type":["string","null"]},"region":{"type":["string","null"]},"postalCode":{"type":["string","null"]},"country":{"type":["string","null"]},"notes":{"type":["string","null"]},"editedFields":{"type":"array","items":{"type":"string"},"description":"Fields a person changed, which reading the card again leaves alone."},"documentId":{"type":["string","null"]},"logoUrl":{"description":"The logo cut from the card, signed for 15 minutes. It stays when the card is deleted.","type":["string","null"]},"faxes":{"type":"array","items":{"type":"string"},"description":"Every fax number on the card, the first being fax."},"cardImageUrl":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","firstName","lastName","company","title","emails","phones","mobile","fax","website","address","city","region","postalCode","country","notes","editedFields","documentId","logoUrl","faxes","cardImageUrl","thumbnailUrl","createdAt","updatedAt"]},"ContactPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"CustomField":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["TEXT","NUMBER","DATE","SELECT","BOOLEAN"]},"options":{"type":"array","items":{"type":"string"}},"required":{"type":"boolean"},"position":{"type":"number"}},"required":["id","key","label","type","options","required","position"]},"CustomFieldPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"DeviceBlock":{"type":"object","properties":{"id":{"type":"string"},"deviceId":{"type":"string"},"reason":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","deviceId","reason","createdAt"]},"DeviceBlockPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DeviceBlock"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"DeviceBlockStatus":{"type":"object","properties":{"deviceId":{"type":"string"},"blocked":{"type":"boolean"},"block":{"anyOf":[{"$ref":"#/components/schemas/DeviceBlock"},{"type":"null"}]}},"required":["deviceId","blocked","block"]},"MyDeviceStatus":{"type":"object","properties":{"deviceId":{"type":"string"},"blocked":{"type":"boolean"}},"required":["deviceId","blocked"]},"Document":{"type":"object","properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/DocumentType"},"source":{"$ref":"#/components/schemas/DocumentSource"},"status":{"$ref":"#/components/schemas/DocumentStatus"},"originalFilename":{"type":["string","null"]},"mimeType":{"type":"string"},"sizeBytes":{"type":"number"},"pageCount":{"type":"number"},"externalId":{"type":["string","null"]},"folderId":{"type":["string","null"]},"expenseId":{"type":["string","null"]},"mailInBatchId":{"type":["string","null"]},"title":{"type":["string","null"]},"notes":{"type":["string","null"]},"latitude":{"description":"Where the device said it was when the photo was taken.","type":["number","null"]},"longitude":{"type":["number","null"]},"locationAccuracyM":{"type":["number","null"]},"duplicateOfId":{"type":["string","null"]},"processingError":{"type":["string","null"]},"processingErrorCode":{"anyOf":[{"type":"string","enum":["FILE_ENCRYPTED"]},{"type":"null"}],"description":"Set when the failure is one the file's owner can fix. processingError says what to do."},"verification":{"type":"string"},"capturedAt":{"type":["string","null"]},"processedAt":{"type":["string","null"]},"viewedAt":{"type":["string","null"]},"archivedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"uploadedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"url":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all."},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}],"description":"Null when the page is not one, and for a caller without expenses.read_all."},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Blank for a caller without expenses.read_all. Value null means nothing could say."},"language":{"type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]}},"ocrScore":{"type":["number","null"]},"isFront":{"description":"A check: the front or the back.","type":["boolean","null"]},"tiffRejectScore":{"description":"A check: 0 is a clean clearing image and 1 is one a bank would send back.","type":["number","null"]},"tiffUpscaled":{"description":"A check: the photo was under 240 DPI, so the clearing image was enlarged.","type":["boolean","null"]}},"required":["index","url","thumbnailUrl","width","height","isBlurry","glare","isLcd","screenshot","aiGenerated","language","languages","ocrScore","isFront","tiffRejectScore","tiffUpscaled"]}},"classification":{"anyOf":[{"type":"object","properties":{"value":{"type":"string","description":"A document class, or one of the labels the caller named."},"score":{"type":"number","description":"0..1."},"engine":{"type":"string","enum":["rules","claude"]},"scores":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"score":{"type":"number"}},"required":["value","score"]},"description":"The runners-up, best first."}},"required":["value","score","engine","scores"]},{"type":"null"}],"description":"What the classifier decided, when it was asked."},"blueprint":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"version":{"description":"Null for a built-in, which has no versions.","type":["number","null"]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"The fields the blueprint defines. Null when the run failed."},"offsets":{"description":"Where each value sits in the text, for a blueprint that asks.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"begin":{"type":"number"},"end":{"type":"number"}},"required":["begin","end"]}},"unmatched":{"description":"Fields where a value was read and did not fit, such as words where a number belongs or a choice off the list. Each is left empty. An empty field not named here was not on the document.","type":"array","items":{"type":"string"}},"error":{"description":"Why the run gave nothing back.","type":["string","null"]}},"required":["name","version","result","error"]},{"type":"null"}],"description":"The blueprint this was read with, and what came out of it."},"tags":{"type":"array","items":{"type":"string"}},"tagRefs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"The same tags with their ids, which a tag route takes."},"recordStatus":{"anyOf":[{"type":"string","enum":["processed","reviewed","archived"]},{"type":"null"}],"description":"Where a read document stands: reviewedAt and archivedAt in one word. Null until it has been read."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."},"setId":{"description":"The upload this came out of: a ZIP, a split PDF or a batch of addresses.","type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"type":"null"}],"description":"Values the workspace custom field rules read out of the text."},"enrichment":{"anyOf":[{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","DONE","FAILED"]},"steps":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}},"failed":{"type":"array","items":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]}}},"required":["status","steps","failed"]},{"type":"null"}],"description":"Work still running after the first answer."},"extraction":{"anyOf":[{"type":"object","properties":{"fields":{"type":"object","properties":{"documentType":{"default":"RECEIPT","$ref":"#/components/schemas/DocumentType"},"merchantName":{"type":["string","null"]},"merchantAddress":{"type":["string","null"]},"merchantPhone":{"type":["string","null"]},"merchantWebsite":{"type":["string","null"]},"merchantTaxId":{"type":["string","null"]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"time":{"type":["string","null"]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","enum":["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHF","CLP","CNY","COP","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","UYU","UZS","VES","VND","VUV","WST","XAF","XCD","XCG","XOF","XPF","YER","ZAR","ZMW","ZWG","CUC","HRK","SLL","ZWL","XDR","XSU"]},{"type":"null"}]},"currencyGuessed":{"default":false,"type":"boolean"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxLines":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"ratePct":{"type":["number","null"]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"baseMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"code":{"type":["string","null"]},"totalInclusive":{"type":["boolean","null"]}},"required":["amountMinor"]}},"tipMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"shippingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"paymentType":{"anyOf":[{"$ref":"#/components/schemas/PaymentType"},{"type":"null"}]},"cardBrand":{"type":["string","null"]},"cardLast4":{"type":["string","null"]},"receiptNumber":{"type":["string","null"]},"invoiceNumber":{"type":["string","null"]},"poNumber":{"type":["string","null"]},"lineItems":{"default":[],"type":"array","items":{"type":"object","properties":{"description":{"type":"string"},"sku":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unitPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountMinor":{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},"taxMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"id":{"type":["string","null"]},"order":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"text":{"type":["string","null"]},"type":{"anyOf":[{"$ref":"#/components/schemas/LineItemType"},{"type":"null"}]},"fullDescription":{"type":["string","null"]},"normalizedDescription":{"type":["string","null"]},"section":{"type":["string","null"]},"reference":{"type":["string","null"]},"upc":{"type":["string","null"]},"hsn":{"type":["string","null"]},"lot":{"type":["string","null"]},"tags":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"unitOfMeasure":{"type":["string","null"]},"discountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"discountRatePct":{"type":["number","null"]},"discountPriceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"taxRatePct":{"type":["number","null"]},"taxCode":{"type":["string","null"]},"subtotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"grossTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"netTotalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"startDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"category":{"type":["string","null"]},"customCategories":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"countryOfOrigin":{"type":["string","null"]},"manufacturer":{"type":["string","null"]},"weight":{"type":["string","null"]},"brand":{"type":["string","null"]},"hsaFsaEligible":{"type":["boolean","null"]},"productInfo":{"anyOf":[{"type":"object","properties":{"expandedDescription":{"type":["string","null"]},"brand":{"type":["string","null"]},"categoryPath":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}}},{"type":"null"}]}},"required":["description","amountMinor"]}},"suggestedCategory":{"type":["string","null"]},"documentTitle":{"type":["string","null"]},"documentReferenceNumber":{"type":["string","null"]},"isDocument":{"type":["boolean","null"]},"isTransaction":{"type":["boolean","null"]},"isMoneyIn":{"type":["boolean","null"]},"accountingEntryType":{"anyOf":[{"type":"string","enum":["debit","credit"]},{"type":"null"}]},"vendor":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"vendors":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":["string","null"]},"rawName":{"type":["string","null"]},"type":{"type":["string","null"]},"logo":{"type":["string","null"]},"logoName":{"type":["string","null"]},"externalId":{"type":["string","null"]},"category":{"type":["string","null"]},"orderNumber":{"type":["string","null"]},"countryCode":{"type":["string","null"]},"address":{"type":["string","null"]},"rawAddress":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"phoneNumber":{"type":["string","null"]},"faxNumber":{"type":["string","null"]},"email":{"type":["string","null"]},"web":{"type":["string","null"]},"lat":{"type":["number","null"]},"lng":{"type":["number","null"]},"mapUrl":{"type":["string","null"]},"vatNumber":{"type":["string","null"]},"isValidatedVatNumber":{"type":["boolean","null"]},"regNumber":{"type":["string","null"]},"abnNumber":{"type":["string","null"]},"isRegisteredForGst":{"type":["boolean","null"]},"bank":{"anyOf":[{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}},{"type":"null"}]}}}},{"type":"null"}]},"bankBreakdown":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"accountName":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"accountCurrency":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankNames":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankAddress":{"type":["string","null"]},"bankAddresses":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankNumber":{"type":["string","null"]},"bankNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"bankSwift":{"type":["string","null"]},"iban":{"type":["string","null"]},"billerCode":{"type":["string","null"]}}}},{"type":"null"}]},"billTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"vatNumber":{"type":["string","null"]},"regNumber":{"type":["string","null"]},"phoneNumber":{"type":["string","null"]},"email":{"type":["string","null"]}}},{"type":"null"}]},"shipTo":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"address":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]}}},{"type":"null"}]},"insuranceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cashbackMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"roundingMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"finalBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"previousBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"totalQuantity":{"type":["number","null"]},"totalWeight":{"type":["string","null"]},"payment":{"anyOf":[{"type":"object","properties":{"cardNumber":{"type":["string","null"]},"displayName":{"type":["string","null"]},"terms":{"type":["string","null"]},"type":{"anyOf":[{"$ref":"#/components/schemas/PaymentMethod"},{"type":"null"}]}}},{"type":"null"}]},"orderDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"shipDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"deliveryDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"serviceEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"exchangeRate":{"type":["number","null"]},"countryCode":{"type":["string","null"]},"deliveryNoteNumber":{"type":["string","null"]},"trackingNumber":{"type":["string","null"]},"trackingNumbers":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"incoterms":{"type":["string","null"]},"weights":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"licensePlateNumber":{"type":["string","null"]},"vinNumber":{"type":["string","null"]},"guestCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"serverName":{"type":["string","null"]},"storeNumber":{"type":["string","null"]},"vendingPerson":{"type":["string","null"]},"vendingPersonNumber":{"type":["string","null"]},"customerAccountNumber":{"type":["string","null"]},"category":{"type":["string","null"]},"defaultCategory":{"type":["string","null"]},"barcodes":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"data":{"type":"string"},"type":{"$ref":"#/components/schemas/BarcodeType"},"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"boundingRegion":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}]}},"required":["data","type","page"]}},{"type":"null"}]},"paymentLinks":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"source":{"type":"string","enum":["text","hyperlink","qr_code","barcode"]}},"required":["url","source"]}},{"type":"null"}]},"folio":{"anyOf":[{"type":"object","properties":{"arrivalDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"departureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"roomNumber":{"type":["string","null"]},"guestName":{"type":["string","null"]},"nights":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"confirmationNumber":{"type":["string","null"]}}},{"type":"null"}]},"enrichedFields":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"check":{"anyOf":[{"type":"object","properties":{"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"amountText":{"type":["string","null"]},"amountsAgree":{"type":["boolean","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"checkNumber":{"type":["string","null"]},"checkType":{"anyOf":[{"$ref":"#/components/schemas/CheckType"},{"type":"null"}]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"memo":{"type":["string","null"]},"payerName":{"type":["string","null"]},"payerAddress":{"type":["string","null"]},"receiverName":{"type":["string","null"]},"receiverAddress":{"type":["string","null"]},"isSigned":{"type":["boolean","null"]},"endorsement":{"anyOf":[{"type":"object","properties":{"isEndorsed":{"type":["boolean","null"]},"isSigned":{"type":["boolean","null"]},"mobileOrRemoteDeposit":{"anyOf":[{"type":"object","properties":{"checkbox":{"type":["boolean","null"]},"instructions":{"type":["boolean","null"]}}},{"type":"null"}]},"isMobileOrRemoteDepositOnly":{"type":["boolean","null"]}}},{"type":"null"}]},"micr":{"anyOf":[{"type":"object","properties":{"routingNumber":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"serialNumber":{"type":["string","null"]},"raw":{"type":["string","null"]},"branch":{"type":["string","null"]},"institution":{"type":["string","null"]},"transactionCode":{"type":["string","null"]}}},{"type":"null"}]},"fractionalRoutingNumber":{"type":["string","null"]},"routingFromFractional":{"type":["string","null"]},"voidTerms":{"type":["string","null"]}}},{"type":"null"}]},"statement":{"anyOf":[{"type":"object","properties":{"accountHolderName":{"type":["string","null"]},"accountHolderAddress":{"type":["string","null"]},"accountType":{"type":["string","null"]},"accountNumber":{"type":["string","null"]},"bankName":{"type":["string","null"]},"bankAddress":{"type":["string","null"]},"bankWebsite":{"type":["string","null"]},"bankVatNumber":{"type":["string","null"]},"accountVatNumber":{"type":["string","null"]},"periodStartDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"periodEndDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"statementNumber":{"type":["string","null"]},"currency":{"anyOf":[{"type":"string","pattern":"^[A-Z]{3}$"},{"type":"null"}]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"minimumDueMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dueDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"routingNumber":{"type":["string","null"]},"swift":{"type":["string","null"]},"iban":{"type":["string","null"]},"accounts":{"default":[],"type":"array","items":{"type":"object","properties":{"number":{"type":["string","null"]},"ibanNumber":{"type":["string","null"]},"accountType":{"type":["string","null"]},"beginningBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"endingBalanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"summaries":{"default":[],"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"totalMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["name"]}},"transactions":{"default":[],"type":"array","items":{"type":"object","properties":{"order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"postedDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"description":{"type":["string","null"]},"category":{"type":["string","null"]},"vendor":{"type":["string","null"]},"transactionId":{"type":["string","null"]},"debitAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"creditAmountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"balanceMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"cardNumber":{"type":["string","null"]},"text":{"type":["string","null"]},"customFields":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"page":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["order"]}}}}},"balancesAgree":{"type":["boolean","null"]}}},{"type":"null"}]},"taxForm":{"anyOf":[{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/TaxFormKind"},"w2":{"anyOf":[{"type":"object","properties":{"employeeSsn":{"type":["string","null"]},"ein":{"type":["string","null"]},"employerName":{"type":["string","null"]},"employerAddress":{"type":["string","null"]},"controlNumber":{"type":["string","null"]},"employeeName":{"type":["string","null"]},"employeeAddress":{"type":["string","null"]},"wagesOtherComps":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"federalIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareWages":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"medicareTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"ssTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"allocatedTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"advanceEicPayment":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"dependentCareBenefits":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"nonQualifiedPlans":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"box12":{"default":[],"type":"array","items":{"type":"object","properties":{"box":{"type":"string"},"code":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["box","code"]}},"is13a":{"type":["boolean","null"]},"is13b":{"type":["boolean","null"]},"is13c":{"type":["boolean","null"]},"box14Other":{"default":[],"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"amountMinor":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]}},"required":["label"]}},"stateLines":{"default":[],"type":"array","items":{"type":"object","properties":{"state":{"type":["string","null"]},"employerStateId":{"type":["string","null"]},"stateWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"stateIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localWagesTips":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localIncomeTax":{"anyOf":[{"type":"integer","minimum":-10000000000000,"maximum":10000000000000},{"type":"null"}]},"localityName":{"type":["string","null"]}}}},"taxYear":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}}},{"type":"null"}]},"w9":{"anyOf":[{"type":"object","properties":{"name":{"type":["string","null"]},"businessName":{"type":["string","null"]},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"parsedAddress":{"anyOf":[{"type":"object","properties":{"building":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"countryAlpha2":{"type":["string","null"]},"postcode":{"type":["string","null"]},"state":{"type":["string","null"]},"streetAddress":{"type":["string","null"]},"house":{"type":["string","null"]},"houseNumber":{"type":["string","null"]},"road":{"type":["string","null"]},"unit":{"type":["string","null"]},"level":{"type":["string","null"]},"staircase":{"type":["string","null"]},"entrance":{"type":["string","null"]},"poBox":{"type":["string","null"]},"suburb":{"type":["string","null"]},"cityDistrict":{"type":["string","null"]},"island":{"type":["string","null"]},"stateDistrict":{"type":["string","null"]},"countryRegion":{"type":["string","null"]},"worldRegion":{"type":["string","null"]}}},{"type":"null"}]},"individual":{"type":["boolean","null"]},"cCorp":{"type":["boolean","null"]},"sCorp":{"type":["boolean","null"]},"partnership":{"type":["boolean","null"]},"trustEstate":{"type":["boolean","null"]},"llc":{"type":["boolean","null"]},"llcType":{"type":["string","null"]},"other":{"type":["boolean","null"]},"otherDescription":{"type":["string","null"]},"exemptPayeeCode":{"type":["string","null"]},"exemption":{"type":["string","null"]},"ssn":{"type":["string","null"]},"ein":{"type":["string","null"]},"accountNumbers":{"type":["string","null"]},"requester":{"type":["string","null"]},"signature":{"type":["boolean","null"]},"signatureDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]}}},{"type":"null"}]},"w8BenE":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","boolean","null"]}},{"type":"null"}]}},"required":["kind"]},{"type":"null"}]},"itinerary":{"anyOf":[{"type":"object","properties":{"travelerName":{"type":["string","null"]},"bookingReference":{"type":["string","null"]},"origin":{"type":["string","null"]},"destination":{"type":["string","null"]},"departsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"returnsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"segments":{"default":[],"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["flight","hotel","car","rail","other"]},"carrier":{"type":["string","null"]},"number":{"type":["string","null"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"departsAt":{"type":["string","null"]},"arrivesAt":{"type":["string","null"]},"confirmationNumber":{"type":["string","null"]},"seat":{"type":["string","null"]}},"required":["kind"]}}}},{"type":"null"}]},"fieldConfidence":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}},"fieldBoxes":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"page":{"type":"number"},"box":{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4}},"required":["page","box"]}}},"description":"What was read, as the extraction contract types it. fieldConfidence holds per-field confidence, 0..1."},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"$ref":"#/components/schemas/IntegrityWarning"},"message":{"type":"string"},"page":{"type":["number","null"]}},"required":["code","message"]},"description":"Integrity findings. A caller without expenses.read_all sees the arithmetic and dates only."}},"required":["fields","confidence","flags","warnings"]},{"type":"null"}]},"fraud":{"anyOf":[{"$ref":"#/components/schemas/DocumentFraud"},{"type":"null"}]},"sealed":{"type":"array","items":{"$ref":"#/components/schemas/SealedValue"},"description":"Bank and tax numbers read from this document, as masks. POST /v1/documents/{id}/reveal opens them."},"updatedAt":{"type":"string"},"extractor":{"description":"What read it: rules, claude, a blueprint, business-card, or none.","type":["string","null"]},"ocrText":{"description":"Everything read off the page. Card, bank and tax numbers are masked.","type":["string","null"]},"pdfUrl":{"description":"The PDF as uploaded, signed for 15 minutes. Null for an image, and for a PDF that prints a number only a reveal hands out.","type":["string","null"]},"meta":{"$ref":"#/components/schemas/DocumentMeta"},"reviewedAt":{"description":"A person checked what was read.","type":["string","null"]},"approvedAt":{"description":"A developer's own approved flag. An expense's approval is a different thing.","type":["string","null"]}},"required":["id","type","source","status","originalFilename","mimeType","sizeBytes","pageCount","externalId","folderId","expenseId","mailInBatchId","title","notes","latitude","longitude","locationAccuracyM","duplicateOfId","processingError","processingErrorCode","verification","capturedAt","processedAt","viewedAt","archivedAt","createdAt","uploadedBy","pages","classification","blueprint","tags","tagRefs","recordStatus","duplicates","setId","customFields","enrichment","extraction","fraud","sealed","updatedAt","extractor","ocrText","pdfUrl","meta","reviewedAt","approvedAt"]},"DocumentOriginal":{"type":"object","properties":{"url":{"type":"string","description":"Signed for 15 minutes. Opening it downloads the file as uploaded."},"filename":{"type":"string"},"mimeType":{"type":"string"}},"required":["url","filename","mimeType"]},"RevealedDocument":{"type":"object","properties":{"documentId":{"type":"string"},"values":{"type":"array","items":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/SensitiveKind"},"masked":{"type":"string","description":"All but the last few characters are stars. Punctuation stays where it was."},"field":{"type":["string","null"]},"page":{"type":"number"},"id":{"type":"string"},"value":{"type":"string","description":"The whole number. Never log or store this."}},"required":["kind","masked","field","page","id","value"]}},"original":{"anyOf":[{"type":"object","properties":{"url":{"type":"string","description":"Signed for 15 minutes."},"filename":{"type":"string"},"mimeType":{"type":"string"}},"required":["url","filename","mimeType"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"tiffUrl":{"description":"A check only: 240 DPI bitonal G4. It prints the MICR line, so it is handed out here and nowhere else.","type":["string","null"]}},"required":["index","tiffUrl"]}}},"required":["documentId","values","original","pages"]},"CheckWithDocument":{"type":"object","properties":{"check":{"$ref":"#/components/schemas/Document"},"document":{"$ref":"#/components/schemas/Document"}},"required":["check","document"]},"DocumentText":{"type":"object","properties":{"text":{"description":"Everything recognized on the document. Card numbers are already masked.","type":["string","null"]},"language":{"type":["string","null"]}},"required":["text","language"]},"DownloadableFile":{"type":"object","properties":{"filename":{"type":"string"},"contentType":{"type":"string"},"content":{"type":"string"}},"required":["filename","contentType","content"]},"ExpenseDetail":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"reference":{"type":"string"},"status":{"$ref":"#/components/schemas/ExpenseStatus"},"kind":{"$ref":"#/components/schemas/ExpenseKind"},"merchantName":{"type":["string","null"]},"tripTitle":{"description":"For a trip, what to call it in a list.","type":["string","null"]},"description":{"type":["string","null"]},"date":{"type":"string"},"currency":{"type":"string"},"amountMinor":{"type":"number"},"baseAmountMinor":{"type":"number"},"taxMinor":{"type":["number","null"]},"category":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"alsoCategories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"Further categories it can be found under. Its money stays in category."},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":["string","null"]}},"required":["id","name","code"]},{"type":"null"}]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"owner":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"moneyFlow":{"type":"string","enum":["IN","OUT"],"description":"Which way the money went."},"invoiceNumber":{"type":["string","null"]},"matched":{"type":"boolean","description":"A card charge has been matched to it."},"connectedApps":{"type":"array","items":{"type":"string"},"description":"Connected services it has been posted to."},"reportId":{"type":["string","null"]},"externalId":{"description":"A developer's own reference, exactly as sent.","type":["string","null"]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"anyOf":[{"$ref":"#/components/schemas/PaymentType"},{"type":"null"}]},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseFlag"}},"reviewFields":{"type":"array","items":{"type":"string"}},"thumbnailUrl":{"type":["string","null"]},"documentId":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":["string","null"]}},"required":["id","name","color"]}},"attendeeCount":{"type":"number"},"fxRate":{"type":"number","description":"What one unit of the expense currency is worth in the base currency. Zero means no rate is available yet, so baseAmountMinor is zero too and the expense is held in review."},"held":{"type":"boolean","description":"Held back from its report until someone releases it."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"notes":{"type":["string","null"]},"subtotalMinor":{"type":["number","null"]},"tipMinor":{"type":["number","null"]},"discountMinor":{"type":["number","null"]},"shippingMinor":{"type":["number","null"]},"paymentAccountId":{"type":["string","null"]},"cardLast4":{"type":["string","null"]},"poNumber":{"description":"The buyer's purchase order number, as an invoice prints it.","type":["string","null"]},"dueDate":{"description":"When an invoice falls due.","type":["string","null"]},"mcc":{"description":"The merchant category code a card network gave the merchant, four digits.","type":["string","null"]},"taxDeductible":{"type":"boolean"},"quantity":{"type":["number","null"]},"rateMinor":{"type":["number","null"]},"unit":{"type":["string","null"]},"trip":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"vehicleId":{"type":["string","null"]},"attendees":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"}},"required":["name"]}},"customFields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"editedFields":{"type":"array","items":{"type":"string"}},"duplicateOfId":{"type":["string","null"]},"duplicateReview":{"anyOf":[{"type":"object","properties":{"outcome":{"type":"string","enum":["DISMISSED","KEPT"]},"reason":{"type":"string"},"engine":{"type":"string","enum":["rules","claude"]},"at":{"type":"string"}},"required":["outcome","reason","engine","at"]},{"type":"null"}],"description":"What the second look at a flagged copy decided, and why."},"canSettleDuplicate":{"type":"boolean","description":"Whether the caller can answer the duplicate question on this expense."},"splitParentId":{"type":["string","null"]},"access":{"description":"What the caller may do with it.","$ref":"#/components/schemas/ExpenseAccess"},"splitInto":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"amountMinor":{"type":"number"}},"required":["id","reference","amountMinor"]},"description":"This expense was divided: its parts now count in its place."},"mergedIntoId":{"description":"A merge absorbed this expense. Where it went.","type":["string","null"]},"report":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"}},"required":["id","title","status"]},{"type":"null"}],"description":"The report this expense is on, named even where the caller could not list it."},"lines":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseLine"}},"documentIds":{"type":"array","items":{"type":"string"}}},"required":["id","number","reference","status","kind","merchantName","tripTitle","description","date","currency","amountMinor","baseAmountMinor","taxMinor","category","alsoCategories","project","client","owner","moneyFlow","invoiceNumber","matched","connectedApps","reportId","externalId","billable","reimbursable","paymentType","confidence","flags","reviewFields","thumbnailUrl","documentId","tags","attendeeCount","fxRate","held","createdAt","updatedAt","notes","subtotalMinor","tipMinor","discountMinor","shippingMinor","paymentAccountId","cardLast4","poNumber","dueDate","mcc","taxDeductible","quantity","rateMinor","unit","trip","vehicleId","attendees","customFields","editedFields","duplicateOfId","duplicateReview","canSettleDuplicate","splitParentId","access","splitInto","mergedIntoId","report","lines","documentIds"]},"ExpensePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseSummary"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ExpenseTotals":{"type":"object","properties":{"count":{"type":"number"},"moneyOutMinor":{"type":"number","description":"Money out, in the base currency."},"moneyInMinor":{"type":"number","description":"Money in, in the base currency: income, refunds and credits, as a positive figure."},"baseAmountMinor":{"type":"number","description":"In the workspace's base currency. A credit or a refund is negative, so it brings this down."},"currency":{"type":"string"},"unconverted":{"type":"number","description":"Counted, but with no exchange rate yet, so they add nothing to the amount."},"totalMinor":{"type":"number","description":"`baseAmountMinor` in the currency asked for."},"totalCurrency":{"type":"string"},"convertedFrom":{"description":"Set when `totalCurrency` is not the base: the currency it was converted from, at the latest rate.","type":["string","null"]}},"required":["count","moneyOutMinor","moneyInMinor","baseAmountMinor","currency","unconverted","totalMinor","totalCurrency","convertedFrom"]},"ExportJob":{"type":"object","properties":{"id":{"type":"string"},"kind":{"$ref":"#/components/schemas/ExportKind"},"format":{"$ref":"#/components/schemas/ExportFormat"},"status":{"type":"string","enum":["EXPIRED","FAILED","COMPLETED","QUEUED","RUNNING"]},"filters":{"$ref":"#/components/schemas/ExportFilters"},"filename":{"type":["string","null"]},"rowCount":{"type":["number","null"]},"error":{"description":"Why it failed, written for a person.","type":["string","null"]},"notes":{"type":"array","items":{"type":"string"},"description":"What a finished file left out, such as credits a bill import cannot take."},"requestedBy":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"onFinish":{"anyOf":[{"$ref":"#/components/schemas/ExportFinish"},{"type":"null"}],"description":"How the actions the export asked for went. Null when it asked for none."},"createdAt":{"type":"string"},"completedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"downloadUrl":{"description":"Signed, valid for 15 minutes. Null until the file is ready and after it expires.","type":["string","null"]}},"required":["id","kind","format","status","filters","filename","rowCount","error","notes","requestedBy","onFinish","createdAt","completedAt","expiresAt","downloadUrl"]},"ExportJobPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ExportJob"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Folder":{"type":"object","properties":{"id":{"type":"string"},"parentId":{"type":["string","null"]},"name":{"type":"string"},"documentCount":{"type":"number"}},"required":["id","parentId","name","documentCount"]},"FolderPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Folder"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Hold":{"type":"object","properties":{"id":{"type":"string"},"held":{"type":"boolean"},"flags":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseFlag"}}},"required":["id","held","flags"]},"Reached":{"type":"object","properties":{"reached":{"type":"array","items":{"type":"string"},"description":"Who can read it now and has been told."}},"required":["reached"]},"Merchant":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"defaultCategoryId":{"type":["string","null"]},"website":{"type":["string","null"]},"phone":{"type":["string","null"]},"address":{"type":["string","null"]},"taxId":{"type":["string","null"]},"is1099":{"type":"boolean"},"merchantType":{"anyOf":[{"type":"string","enum":["airline","lodging","car_rental","ground_transport","fuel","dining","grocery","office","software","utilities","supplies","other"]},{"type":"null"}],"description":"What kind of business this is. Null lets a rule work it out from the card code or the name."},"expenseCount":{"type":"number"},"totalMinor":{"type":"number","description":"Non-void expenses, in the workspace's base currency."},"aliases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"Other spellings that file here: left by a merge or a rename."}},"required":["id","name","defaultCategoryId","website","phone","address","taxId","is1099","merchantType","expenseCount","totalMinor","aliases"]},"MerchantPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Merchant"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"MileageLog":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/Trip"}},"currency":{"type":"string"},"totals":{"type":"object","properties":{"trips":{"type":"number"},"amountMinor":{"type":"number"},"distances":{"type":"array","items":{"type":"object","properties":{"unit":{"type":"string"},"distance":{"type":"number"}},"required":["unit","distance"]}}},"required":["trips","amountMinor","distances"]},"months":{"type":"array","items":{"$ref":"#/components/schemas/MileageLogMonth"}},"tally":{"anyOf":[{"type":"object","properties":{"year":{"type":"number"},"distance":{"type":"number"},"limit":{"type":"number"},"unit":{"type":"string"},"remaining":{"type":"number"}},"required":["year","distance","limit","unit","remaining"]},{"type":"null"}],"description":"Where the person stands against a yearly limit, for a rate that drops after it."}},"required":["from","to","rows","currency","totals","months","tally"]},"MileageRate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"unit":{"type":"string","enum":["mi","km"]},"rateMinor":{"type":"number","description":"A hundredth of a cent per unit, so 72.5 cents is 7250."},"currency":{"type":"string"},"effectiveFrom":{"type":"string"},"effectiveTo":{"description":"The last day this rate covers. Null runs until a newer rate of the same name.","type":["string","null"]},"isDefault":{"type":"boolean"},"archived":{"type":"boolean"},"taxBasisPoints":{"description":"Tax on the reclaimable part, in hundredths of a percent. 2000 is 20%. Used while the workspace tracks tax on distance.","type":["number","null"]},"taxReclaimableMinor":{"description":"The fixed part of this rate tax can be reclaimed on, at the same scale as rateMinor.","type":["number","null"]},"autoGenerated":{"type":"boolean","description":"The government-rate job added this row, and no admin has changed its amount, start or end."}},"required":["id","name","unit","rateMinor","currency","effectiveFrom","effectiveTo","isDefault","archived","taxBasisPoints","taxReclaimableMinor","autoGenerated"]},"MileageRatePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MileageRate"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"PerDiemRate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"country":{"type":["string","null"]},"region":{"type":["string","null"]},"amountMinor":{"type":"number"},"currency":{"type":"string"},"archived":{"type":"boolean"}},"required":["id","name","country","region","amountMinor","currency","archived"]},"PerDiemRatePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PerDiemRate"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Project":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":["string","null"]},"clientId":{"type":["string","null"]},"clientName":{"type":["string","null"]},"budgetMinor":{"type":["number","null"]},"spentMinor":{"type":"number","description":"Non-void expenses, in the workspace's base currency."},"expenseCount":{"type":"number"},"archived":{"type":"boolean"}},"required":["id","name","code","clientId","clientName","budgetMinor","spentMinor","expenseCount","archived"]},"ProjectPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ReportDetail":{"type":"object","properties":{"purpose":{"type":["string","null"]},"rejectionReason":{"type":["string","null"]},"rejectedAt":{"type":["string","null"]},"reimbursedAt":{"type":["string","null"]},"exportedAt":{"type":["string","null"]},"expenses":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseSummary"}},"findings":{"type":"array","items":{"$ref":"#/components/schemas/PolicyFinding"}},"approvals":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalStep"}},"participants":{"type":"array","items":{"$ref":"#/components/schemas/ReportPerson"},"description":"People added to the report. They can read it and comment, nothing more."},"fields":{"type":"array","items":{"$ref":"#/components/schemas/ReportFieldValue"}},"titleLocked":{"type":"boolean","description":"True when a title typed here would be refused: the workspace's formula sets it."},"noApprovalStep":{"type":"boolean","description":"Submitting needs nobody's approval, so it finishes the report."},"exportable":{"type":"boolean","description":"This person can export this report or share it. Someone added only to read and comment cannot."},"ccEmails":{"type":"array","items":{"type":"string"},"description":"Addresses outside the workspace copied on each submission."},"canPickApprover":{"type":"boolean","description":"A draft whose workflow leaves the next approver open, so the person submitting can name one."},"canSendOutside":{"type":"boolean","description":"A draft in a workspace with nobody else to approve it, which can go to someone outside instead."},"outsideApprover":{"anyOf":[{"type":"object","properties":{"email":{"type":["string","null"]},"expiresAt":{"type":"string"}},"required":["email","expiresAt"]},{"type":"null"}],"description":"Someone with no account has this report, through a link. A null email is a link that went out on a PDF."},"expenseColumns":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"customField1":{"type":["string","null"]},"customField2":{"type":["string","null"]},"mcc":{"type":["string","null"]},"posted":{"type":["string","null"]},"taxCode":{"type":["string","null"]},"taxRate":{"type":["string","null"]}},"required":["customField1","customField2","mcc","posted","taxCode","taxRate"]},"description":"What the expense table's optional columns read, by expense id."},"customFieldLabels":{"type":"object","properties":{"first":{"type":["string","null"]},"second":{"type":["string","null"]}},"required":["first","second"],"description":"The workspace's first two custom fields, which the Custom field 1 and 2 columns show."},"withdrawalId":{"description":"The batch that pays this report.","type":["string","null"]},"internationalReimbursementId":{"description":"The same, where the batch pays in another currency than the workspace's.","type":["string","null"]},"final":{"type":"boolean","description":"Nothing more is due: paid, or approved with nothing to pay, or done."},"findingsAccepted":{"anyOf":[{"type":"object","properties":{"by":{"anyOf":[{"$ref":"#/components/schemas/ReportPerson"},{"type":"null"}]},"at":{"type":"string"}},"required":["by","at"]},{"type":"null"}],"description":"Someone has reviewed and accepted what the receipt checks found."},"auditNote":{"description":"What the receipt audit did on this report, on a plan that has it. There even when it found nothing.","type":["string","null"]},"needsAcceptance":{"type":"boolean","description":"Receipt checks found something, and approving this report has to wait for someone to accept it."},"timeline":{"type":"array","items":{"$ref":"#/components/schemas/ReportTimelineEntry"}},"heldExpenseIds":{"type":"array","items":{"type":"string"}},"actions":{"type":"array","items":{"type":"string","enum":["delete","approve","submit","retract","reject","reopen","close","mark_exported","mark_reimbursed","edit","reassign","duplicate","invite","accept_findings","received_payment"]}},"selfApproval":{"type":"boolean","description":"True when the caller's approval would be a self-approval the workspace allows."},"deciding":{"type":"boolean","description":"The caller holds a step that is live now, for themselves or as a delegate. Without one, a workspace admin has to bypass."},"id":{"type":"string"},"number":{"type":"number"},"reference":{"type":"string"},"title":{"type":"string"},"status":{"$ref":"#/components/schemas/ReportStatus"},"stage":{"type":"string","enum":["DRAFT","SUBMITTED","OUTSTANDING","APPROVED","REJECTED","PAID","EXPORTED","DONE"]},"paymentStage":{"anyOf":[{"type":"string","enum":["MARKED_AS_PAID","WITHDRAWING","CONFIRMED"]},{"type":"null"}]},"owner":{"$ref":"#/components/schemas/ReportPerson"},"currency":{"type":"string"},"totalMinor":{"type":"number"},"reimbursableMinor":{"type":"number"},"expenseCount":{"type":"number"},"findingCount":{"type":"number"},"periodStart":{"type":["string","null"]},"periodEnd":{"type":["string","null"]},"autoCreated":{"type":"boolean"},"waitingOn":{"type":"array","items":{"$ref":"#/components/schemas/ReportPerson"},"description":"Who the report is with right now."},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["purpose","rejectionReason","rejectedAt","reimbursedAt","exportedAt","expenses","findings","approvals","participants","fields","titleLocked","noApprovalStep","exportable","ccEmails","canPickApprover","canSendOutside","outsideApprover","expenseColumns","customFieldLabels","withdrawalId","internationalReimbursementId","final","findingsAccepted","auditNote","needsAcceptance","timeline","heldExpenseIds","actions","selfApproval","deciding","id","number","reference","title","status","stage","paymentStage","owner","currency","totalMinor","reimbursableMinor","expenseCount","findingCount","periodStart","periodEnd","autoCreated","waitingOn","submittedAt","approvedAt","createdAt","updatedAt"]},"ReportPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReportSummary"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Tag":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"groupName":{"type":["string","null"]},"glCode":{"type":["string","null"]},"color":{"type":["string","null"]},"archived":{"type":"boolean"},"expenseCount":{"type":"number"},"approverId":{"description":"Reviews any report carrying this tag, after any category approvers and ahead of the workflow.","type":["string","null"]},"approverName":{"type":["string","null"]},"parentId":{"description":"The tag this one sits under. An expense carrying this one has to carry that one too.","type":["string","null"]},"parentName":{"type":["string","null"]}},"required":["id","name","groupName","glCode","color","archived","expenseCount","approverId","approverName","parentId","parentName"]},"TagPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Tag"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"TaxSummary":{"type":"object","properties":{"year":{"type":"number"},"from":{"type":"string"},"to":{"type":"string"},"fiscalYearStartMonth":{"type":"number"},"currency":{"type":"string"},"notice":{"type":"string"},"mileageNotice":{"type":"string"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/TaxLine"}},"mileage":{"type":"array","items":{"$ref":"#/components/schemas/TaxMileage"}},"unassigned":{"type":"object","properties":{"count":{"type":"number"},"spentMinor":{"type":"number"}},"required":["count","spentMinor"],"description":"Spending on a category with no tax line, or on no category."},"excluded":{"type":"object","properties":{"count":{"type":"number"},"spentMinor":{"type":"number"}},"required":["count","spentMinor"],"description":"Expenses a person marked as not deductible."},"payees":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"rows":{"type":"array","items":{"$ref":"#/components/schemas/TaxPayee"}}},"required":["from","to","rows"],"description":"1099s follow the calendar year whatever the fiscal year, so this has its own dates."},"needsReview":{"type":"number","description":"Counted above, but a person has not confirmed them yet."},"unconverted":{"type":"number","description":"Expenses with no exchange rate yet. They are not in these figures."},"spentMinor":{"type":"number"},"deductibleMinor":{"type":"number"}},"required":["year","from","to","fiscalYearStartMonth","currency","notice","mileageNotice","lines","mileage","unassigned","excluded","payees","needsReview","unconverted","spentMinor","deductibleMinor"]},"TravelTrip":{"type":"object","properties":{"id":{"type":"string"},"ownerId":{"type":"string"},"name":{"type":"string"},"origin":{"type":["string","null"]},"destination":{"type":["string","null"]},"departsOn":{"type":"string","description":"YYYY-MM-DD."},"returnsOn":{"description":"YYYY-MM-DD.","type":["string","null"]},"merchantName":{"type":["string","null"]},"bookingReference":{"type":["string","null"]},"currency":{"type":["string","null"]},"totalMinor":{"description":"In minor units of the currency: 1250 is 12.50.","type":["number","null"]},"segments":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["flight","hotel","car","rail","other"]},"carrier":{"type":["string","null"]},"number":{"type":["string","null"]},"from":{"type":["string","null"]},"to":{"type":["string","null"]},"departsAt":{"type":["string","null"]},"arrivesAt":{"type":["string","null"]},"confirmationNumber":{"type":["string","null"]},"seat":{"type":["string","null"]}},"required":["kind"]},"description":"Flights, stays, cars and trains, in order."},"documentIds":{"type":"array","items":{"type":"string"},"description":"The itinerary and the receipts filed against this trip."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","ownerId","name","origin","destination","departsOn","returnsOn","merchantName","bookingReference","currency","totalMinor","segments","documentIds","createdAt","updatedAt"]},"TravelTripPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TravelTrip"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"Trip":{"type":"object","properties":{"expenseId":{"type":"string"},"reference":{"type":"string"},"status":{"type":"string"},"owner":{"$ref":"#/components/schemas/MoneyPerson"},"date":{"type":"string"},"purpose":{"type":"string"},"origin":{"type":"string"},"stops":{"type":"array","items":{"type":"string"},"description":"Places along the way."},"destination":{"type":"string"},"originLabel":{"description":"The name of a saved place at this address, such as Home.","type":["string","null"]},"destinationLabel":{"type":["string","null"]},"departed":{"description":"HH:MM.","type":["string","null"]},"arrived":{"description":"HH:MM.","type":["string","null"]},"distance":{"type":"number"},"unit":{"type":"string"},"calculation":{"type":"string","description":"How the amount was reached: 8.1 mi x $0.76/mi = $6.16."},"purposeKind":{"type":"string","enum":["business","medical","charity"],"description":"What the trip was for, by the rate it took."},"roundTrip":{"type":"boolean"},"odometerStart":{"type":["number","null"]},"odometerEnd":{"type":["number","null"]},"odometerPhotos":{"type":"object","properties":{"start":{"type":["string","null"]},"end":{"type":["string","null"]},"merged":{"type":["string","null"]}},"required":["start","end","merged"],"description":"Documents holding a photo of each reading, and the one image they are merged into."},"receiptDocumentId":{"description":"The generated mileage receipt.","type":["string","null"]},"vehicle":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"plate":{"type":["string","null"]}},"required":["id","name","plate"]},{"type":"null"}]},"rateMinor":{"type":"number","description":"A hundredth of a cent per unit."},"rateName":{"type":["string","null"]},"amountMinor":{"type":"number"},"currency":{"type":"string"},"entry":{"type":"string","enum":["MANUAL","ODOMETER","MAP","GPS"],"description":"How the distance came to be known. Only MAP and GPS were measured."},"driven":{"type":"number","description":"The whole drive. `distance` is what is claimed, which is less when a commute came off it."},"commuteExcluded":{"description":"The commute taken off this trip, or null if none was.","type":["number","null"]},"taxMinor":{"description":"The tax on this trip, when its workspace tracks tax on distance.","type":["number","null"]}},"required":["expenseId","reference","status","owner","date","purpose","origin","stops","destination","originLabel","destinationLabel","departed","arrived","distance","unit","calculation","purposeKind","roundTrip","odometerStart","odometerEnd","odometerPhotos","receiptDocumentId","vehicle","rateMinor","rateName","amountMinor","currency","entry","driven","commuteExcluded","taxMinor"]},"TripRoutes":{"type":"array","items":{"$ref":"#/components/schemas/TripRoute"}},"ExpenseDetails":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseDetail"}},"ReportSubmittedViaPdf":{"type":"object","properties":{"report":{"$ref":"#/components/schemas/ReportDetail"},"exportJobId":{"type":"string","description":"The export making the PDF. Its download is ready when the job is."}},"required":["report","exportJobId"]},"Vehicle":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"ownerName":{"type":["string","null"]},"name":{"type":"string"},"plate":{"type":["string","null"]},"archived":{"type":"boolean"},"expenseCount":{"type":"number"}},"required":["id","userId","ownerName","name","plate","archived","expenseCount"]},"VehiclePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Vehicle"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ApiKeyVerification":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string","description":"The first characters of the key."},"kind":{"type":"string","enum":["PERSONAL","WORKSPACE"],"description":"PERSONAL acts as the person who made it and ends when they leave. WORKSPACE belongs to the workspace and outlives them."},"environment":{"type":"string","enum":["LIVE","TEST"]},"workspaceId":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"},"description":"Every scope this key holds right now."},"fullAccess":{"type":"boolean","description":"Every scope, present and future."},"role":{"type":"string","description":"The role its reach is measured against: a scope opens a route, and the role decides what the route may do."},"signingRequired":{"type":"boolean","description":"A request with no valid signature is refused."},"expiresAt":{"type":["string","null"]}},"required":["id","name","prefix","kind","environment","workspaceId","scopes","fullAccess","role","signingRequired","expiresAt"]},"ClientCertificate":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"fingerprint":{"type":"string","description":"SHA-256 of the certificate, lowercase hex."},"subject":{"type":["string","null"]},"notAfter":{"type":["string","null"]},"revokedAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","name","fingerprint","subject","notAfter","revokedAt","createdAt"]},"ClientCertificatePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ClientCertificate"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"ReleaseNotePage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReleaseNote"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"endpointId":{"type":"string"},"eventId":{"type":"string"},"eventType":{"type":"string"},"state":{"type":"string","enum":["FAILED","PENDING","DELIVERED","ABANDONED"]},"attempts":{"type":"number"},"responseStatus":{"type":["number","null"]},"responseBody":{"type":["string","null"]},"nextAttemptAt":{"type":["string","null"]},"deliveredAt":{"type":["string","null"]},"createdAt":{"type":"string"},"payload":{}},"required":["id","endpointId","eventId","eventType","state","attempts","responseStatus","responseBody","nextAttemptAt","deliveredAt","createdAt","payload"]},"WebhookDeliveryPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"WebhookEndpoint":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","CONFIRMED"],"description":"PENDING receives the subscription event and nothing else, until POST /v1/webhooks/confirm."},"pendingUntil":{"description":"A pending endpoint not confirmed by then is deleted.","type":["string","null"]},"confirmedAt":{"type":["string","null"]},"apiKeyId":{"description":"Set when this endpoint belongs to one API key rather than the workspace.","type":["string","null"]},"id":{"type":"string"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"failureCount":{"type":"number"},"disabledAt":{"description":"Set while the endpoint is off.","type":["string","null"]},"createdAt":{"type":"string"}},"required":["status","pendingUntil","confirmedAt","apiKeyId","id","url","description","events","enabled","failureCount","disabledAt","createdAt"]},"WebhookEndpointPage":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"nextCursor":{"description":"Pass as `cursor` for the next page. Null on the last one.","type":["string","null"]}},"required":["data","nextCursor"]},"WebhookEndpointWithSecret":{"type":"object","properties":{"status":{"type":"string","enum":["PENDING","CONFIRMED"],"description":"PENDING receives the subscription event and nothing else, until POST /v1/webhooks/confirm."},"pendingUntil":{"description":"A pending endpoint not confirmed by then is deleted.","type":["string","null"]},"confirmedAt":{"type":["string","null"]},"apiKeyId":{"description":"Set when this endpoint belongs to one API key rather than the workspace.","type":["string","null"]},"secret":{"type":"string"},"id":{"type":"string"},"url":{"type":"string"},"description":{"type":["string","null"]},"events":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"failureCount":{"type":"number"},"disabledAt":{"description":"Set while the endpoint is off.","type":["string","null"]},"createdAt":{"type":"string"}},"required":["status","pendingUntil","confirmedAt","apiKeyId","secret","id","url","description","events","enabled","failureCount","disabledAt","createdAt"]},"WebhookEventPayload":{"type":"object","properties":{"id":{"type":"string","description":"Stable across retries, so a repeat can be ignored."},"type":{"type":"string"},"createdAt":{"type":"string"},"data":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["id","type","createdAt","data"]},"AccountingRow":{"type":"object","properties":{"kind":{"type":"string","enum":["report","expense","transaction"]},"id":{"type":"string"},"expenseId":{"description":"The expense behind a card line, when there is one.","type":["string","null"]},"reference":{"type":["string","null"]},"title":{"type":"string"},"person":{"type":["string","null"]},"account":{"type":["string","null"]},"date":{"type":"string","description":"The date the shortcut goes by."},"status":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"baseAmountMinor":{"type":"number","description":"In the workspace's base currency, so a footer can add it up."},"expenses":{"description":"How many expenses a report holds. Null on anything else.","type":["number","null"]},"statement":{"anyOf":[{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"}},"required":["from","to"]},{"type":"null"}],"description":"Card statements: the statement this line is on."},"withdrawal":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"status":{"type":"string"},"method":{"type":"string"},"externalReference":{"type":["string","null"]},"bankAccount":{"type":["string","null"]}},"required":["id","reference","status","method","externalReference","bankAccount"]},{"type":"null"}]}},"required":["kind","id","expenseId","reference","title","person","account","date","status","amountMinor","currency","baseAmountMinor","expenses","statement","withdrawal"]},"AgentActivity":{"type":"object","properties":{"id":{"type":"string"},"trigger":{"type":"string","enum":["ASK","EVENT","SCHEDULE"]},"status":{"type":"string"},"summary":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","trigger","status","summary","createdAt"]},"AgentTemplate":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"instructions":{"type":"string"},"plan":{"anyOf":[{"type":"object","properties":{"events":{"type":"array","items":{"type":"string","enum":["report.submitted","report.auto_approved","report.step_approved","report.approved","report.rejected","report.retracted","report.reopened","report.sent_back","report.expense_rejected","report.findings_accepted","expense.held","expense.released","report.created","report.updated","report.deleted","report.reassigned","report.closed","report.held_moved","report.expenses_added","report.expense_removed","report.approver_replaced","report.audit_sampled","report.moved","reimbursement.created","reimbursement.paid","report.reimbursed","reimbursement.failed","reimbursement.reversed","reimbursement.cancelled","reimbursement.overpaid","reimbursement.receipt_confirmed","reimbursement.delayed","reimbursement.returned","expense.reimbursement_stopped","expense.created","expense.updated","expense.voided","expense.restored","expense.split","expense.duplicate_kept","expense.receipt_merged","expense.receipt_attached","expense.receipt_replaced","expense.corrected","expense.violation_dismissed","document.created","document.deleted","document.processed","document.failed","comment.added","comment.mentioned","report.participant_added","report.participant_removed","room.member_added","room.member_removed","task.created","task.reassigned","task.completed","task.reopened","document.shared","payment_account.assigned","payment_account.unassigned","payment_account.created","payment_account.archived","plaid.connected","plaid.reconnected","plaid.removed","card.feed_broken","transaction.matched","transaction.unmatched","report.exported","export.requested","integration.sync_failed","integration.needs_attention","travel.trip_changed","billing.subscription_changed","billing.seats_changed","member.role_changed","member.suspended","member.updated","invitation.created","invitation.accepted","workflow.created","workflow.updated","workflow.deleted","policy.created","policy.updated","policy.deleted","budget.created","budget.updated","budget.deleted","integration.connected","integration.disconnected","payee_bank_account.saved","payee_bank_account.removed","reimbursement.settings_saved"]}},"branches":{"type":"array","items":{"type":"object","properties":{"when":{"type":"array","items":{"type":"object","properties":{"field":{"$ref":"#/components/schemas/AgentField"},"op":{"$ref":"#/components/schemas/AgentOperator"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}},{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2},{"type":"boolean"}]}},"required":["field","op","value"]}},"then":{"type":"array","items":{"type":"object","properties":{"tool":{"$ref":"#/components/schemas/AgentStepTool"},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]},"description":"Fixed when a person approved the rule. The subject is always what the event was about, so a step names no record."}},"required":["tool","input"]}},"ask":{"description":"A yes-or-no question a condition cannot settle. A reader with no tools answers it, and only a person can then write.","type":"string"}},"required":["when","then"]},"description":"The first branch whose conditions hold is the one that runs, so \"and all other reports\" is a last branch with none."}},"required":["events","branches"]},{"type":"null"}],"description":"Null when it only talks."},"needsClaude":{"type":"boolean","description":"Needs Claude to run. Everything else here is code."}},"required":["key","name","description","instructions","plan","needsClaude"]},"ApiCall":{"type":"object","properties":{"id":{"type":"string"},"actorType":{"type":"string","enum":["API_KEY","OAUTH"]},"actorId":{"description":"The API key's id, or the app's client_id.","type":["string","null"]},"actorName":{"description":"The key's or the app's name, while it still exists.","type":["string","null"]},"method":{"type":"string"},"path":{"type":"string"},"status":{"type":"number"},"durationMs":{"type":"number"},"requestId":{"type":["string","null"]},"ip":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","actorType","actorId","actorName","method","path","status","durationMs","requestId","ip","createdAt"]},"ApprovalCounts":{"type":"object","properties":{"pending":{"type":"number"},"clean":{"type":"number"},"flagged":{"type":"number"},"delegated":{"type":"number"}},"required":["pending","clean","flagged","delegated"]},"ApprovalQueueItem":{"type":"object","properties":{"stepId":{"type":"string"},"level":{"type":"number"},"report":{"$ref":"#/components/schemas/ReportSummary"},"approver":{"$ref":"#/components/schemas/ReportPerson"},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/ReportPerson"},{"type":"null"}],"description":"The approver this step belongs to, when the caller is acting as their delegate."},"clean":{"type":"boolean"},"heldCount":{"type":"number"},"waitingSince":{"type":"string"}},"required":["stepId","level","report","approver","onBehalfOf","clean","heldCount","waitingSince"]},"ApprovalStep":{"type":"object","properties":{"id":{"type":"string"},"level":{"type":"number"},"approver":{"$ref":"#/components/schemas/ReportPerson"},"actedBy":{"anyOf":[{"$ref":"#/components/schemas/ReportPerson"},{"type":"null"}],"description":"Set when someone else acted for the approver."},"state":{"type":"string","enum":["APPROVED","REJECTED","PENDING","SKIPPED","WAITING"]},"comment":{"type":["string","null"]},"decidedAt":{"type":["string","null"]}},"required":["id","level","approver","actedBy","state","comment","decidedAt"]},"ArchivedReport":{"type":"object","properties":{"number":{"type":"number"},"title":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"totalMinor":{"type":"number"},"submittedAt":{"type":["string","null"]},"owner":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"date":{"type":["string","null"]},"merchant":{"type":["string","null"]},"category":{"type":["string","null"]},"amountMinor":{"type":"number"},"currency":{"type":"string"}},"required":["date","merchant","category","amountMinor","currency"]}}},"required":["number","title","status","currency","totalMinor","submittedAt","owner","lines"]},"AuditEvent":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string"},"actorType":{"type":"string","enum":["USER","API_KEY","STAFF","SYSTEM","OAUTH"]},"actorId":{"type":["string","null"]},"actorName":{"description":"The person, or the name of the API key. Null for the system.","type":["string","null"]},"onBehalfOfName":{"description":"The person this was done for, when the actor was a delegate. `metadata.onBehalfOf` holds their id.","type":["string","null"]},"affectedName":{"description":"The person the change was about, when it was about a person: a member whose role changed, say.","type":["string","null"]},"entityType":{"type":["string","null"]},"entityId":{"type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"createdAt":{"type":"string"}},"required":["id","action","actorType","actorId","actorName","onBehalfOfName","affectedName","entityType","entityId","metadata","createdAt"]},"BankReconciliationExpense":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"categoryName":{"type":["string","null"]},"amountMinor":{"type":"number"},"currency":{"type":"string"},"baseAmountMinor":{"type":"number"}},"required":["id","reference","merchantName","date","categoryName","amountMinor","currency","baseAmountMinor"]},"BillingInvoice":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":["string","null"]},"status":{"type":["string","null"]},"currency":{"type":"string"},"totalMinor":{"type":"number"},"amountPaidMinor":{"type":"number"},"amountDueMinor":{"type":"number"},"createdAt":{"type":"string"},"periodStart":{"type":["string","null"]},"periodEnd":{"type":["string","null"]},"hostedUrl":{"description":"Stripe's page for the invoice.","type":["string","null"]},"pdfUrl":{"description":"Stripe's PDF of it.","type":["string","null"]}},"required":["id","number","status","currency","totalMinor","amountPaidMinor","amountDueMinor","createdAt","periodStart","periodEnd","hostedUrl","pdfUrl"]},"BillingPlan":{"type":"object","properties":{"extraSeatYearlyMinor":{"description":"Per extra member per year, for yearly billing. Null when extra members are not sold.","type":["number","null"]},"key":{"$ref":"#/components/schemas/PlanKey"},"name":{"type":"string"},"tagline":{"type":"string"},"mailInTagline":{"description":"Replaces `tagline` while paper mail-in is on. `offeredPlan` picks one, so nothing reads this directly.","type":"string"},"priceMonthlyMinor":{"type":"number","description":"Prices in USD cents. The yearly price is the whole year, charged once. One price everywhere: every figure here is also an App Store and Google Play price point, so a store never costs more or less. Apple steps by $5 above $200 and by $10 above $500, which is why $290 and $790 and not $289 and $789."},"priceYearlyMinor":{"type":"number"},"extraSeatMonthlyMinor":{"description":"Per extra member per month beyond `seatsIncluded`. Null when extra seats are not sold. On a yearly plan an extra member is twelve of these, $72 on Pro and $96 on Business, on purpose: the yearly discount is for the plan, and a seat carries none. `seatPriceMinor` is where that is worked out.","type":["number","null"]},"limits":{"$ref":"#/components/schemas/PlanLimits"},"features":{"type":"array","items":{"type":"string","enum":["mileage","policies","receipt_capture","email_capture","expense_reports","tax_reports","standard_exports","multi_currency","business_cards","mail_in","automation_rules","card_feeds","accounting_sync","approvals","reimbursements","custom_fields","per_diem","human_verification","developer_api","multi_level_approvals","sso","audit_log","scheduled_reports"]}}},"required":["extraSeatYearlyMinor","key","name","tagline","priceMonthlyMinor","priceYearlyMinor","extraSeatMonthlyMinor","limits","features"]},"BlueprintSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","description":"What blueprint_name takes."},"title":{"type":"string"},"documentType":{"$ref":"#/components/schemas/DocumentType"},"builtIn":{"type":"boolean","description":"Ships with PaperTotal, and can be used and not changed."},"version":{"type":"number","description":"Changing a blueprint adds a version, and results keep the one that made them."}},"required":["id","name","title","documentType","builtIn","version"]},"BreakdownRow":{"type":"object","properties":{"id":{"description":"The category, merchant, member, project, tag or department. Null is the row for expenses with none.","type":["string","null"]},"label":{"type":"string"},"totalMinor":{"type":"number"},"count":{"type":"number"},"previousMinor":{"type":"number"},"changePct":{"type":["number","null"]},"sharePct":{"type":"number","description":"Of the period's total, one decimal."}},"required":["id","label","totalMinor","count","previousMinor","changePct","sharePct"]},"BudgetStanding":{"type":"object","properties":{"limitMinor":{"type":"number"},"spentMinor":{"type":"number","description":"Approved or paid."},"pendingMinor":{"type":"number","description":"Not void or rejected, and not approved yet: what is on its way."},"remainingMinor":{"type":"number","description":"Below zero once the limit is passed."},"percentUsed":{"type":"number","description":"Of the limit, rounded down."}},"required":["limitMinor","spentMinor","pendingMinor","remainingMinor","percentUsed"]},"CardStatement":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"open":{"type":"boolean","description":"True for the period still open today."},"count":{"type":"number"},"spentMinor":{"type":"number"},"creditedMinor":{"type":"number"},"netMinor":{"type":"number"},"currency":{"type":"string"}},"required":["from","to","open","count","spentMinor","creditedMinor","netMinor","currency"]},"ChartBar":{"type":"object","properties":{"label":{"type":"string"},"valueMinor":{"type":"number"},"href":{"description":"Where choosing this bar leads. Null when it cannot be narrowed to a filter.","type":["string","null"]}},"required":["label","valueMinor","href"]},"Chart":{"type":"object","properties":{"title":{"type":"string"},"currency":{"type":"string"},"bars":{"type":"array","items":{"$ref":"#/components/schemas/ChartBar"}}},"required":["title","currency","bars"]},"ChatPerson":{"type":"object","properties":{"phone":{"type":["string","null"]},"agent":{"description":"True for an agent's account, so a client never reads it as a person.","type":"boolean"},"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"ClientWorkspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"$ref":"#/components/schemas/MemberRole"},"baseCurrency":{"type":"string"},"timezone":{"type":"string"},"dateFormat":{"description":"How dates read in that workspace. The API always sends YYYY-MM-DD.","$ref":"#/components/schemas/DateFormat"},"todo":{"type":"object","properties":{"total":{"type":"number","description":"Everything below added up."},"needsReview":{"type":"number"},"awaitingApproval":{"type":"number"},"awaitingPayment":{"type":"number"},"unmatchedCharges":{"type":"number"}},"required":["total","needsReview","awaitingApproval","awaitingPayment","unmatchedCharges"]},"billing":{"type":"object","properties":{"plan":{"type":["string","null"]},"active":{"type":"boolean"},"canManage":{"type":"boolean","description":"Whether this person can change the plan there."}},"required":["plan","active","canManage"]}},"required":["id","name","role","baseCurrency","timezone","dateFormat","todo","billing"]},"DocumentCounts":{"type":"object","properties":{"added":{"type":"number"},"read":{"type":"number"},"reading":{"type":"number"},"failed":{"type":"number"}},"required":["added","read","reading","failed"]},"DocumentFraud":{"type":"object","properties":{"version":{"type":"string"},"score":{"type":"number","description":"0 to 1, from the signals that fired. Evidence, never a verdict."},"color":{"type":"string","enum":["green","yellow","red"],"description":"Under the workspace yellow threshold is green. Over its red threshold is red."},"types":{"type":"array","items":{"$ref":"#/components/schemas/FraudSignal"},"description":"Signals that fired, most important first."},"details":{"type":"object","propertyNames":{"$ref":"#/components/schemas/FraudSignal"},"additionalProperties":{"type":"object","properties":{"description":{"type":"string"},"confidence":{"type":"number","description":"How sure the detector is of what it saw, 0 to 1. Not how likely fraud is."},"reasons":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Stable."},"description":{"type":"string","description":"Written for a person."},"field":{"description":"Where it was read: exif:Software, totalMinor.","type":["string","null"]},"value":{"type":["string","null"]},"page":{"description":"Zero-based.","type":["number","null"]},"score":{"type":["number","null"]},"box":{"description":"Where on the page, as fractions of its size: x, y, width, height.","anyOf":[{"type":"array","prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"items":false,"minItems":4,"maxItems":4},{"type":"null"}]}},"required":["name","description"]}}},"required":["description","confidence","reasons"]},"description":"By signal: a description, a confidence and typed reasons."},"attribution":{"description":"One sentence naming the strongest evidence.","type":["string","null"]},"decision":{"type":"string","enum":["clear","review","fraud","not_fraud","unknown"],"description":"clear or review until a person decides. Only a person can say fraud."},"review":{"anyOf":[{"type":"object","properties":{"decision":{"$ref":"#/components/schemas/FraudReviewDecision"},"types":{"type":"array","items":{"$ref":"#/components/schemas/FraudSignal"}},"note":{"type":["string","null"]},"reviewedBy":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}]},"reviewedAt":{"type":"string"}},"required":["decision","types","note","reviewedBy","reviewedAt"]},{"type":"null"}]},"deviceId":{"description":"The id the client sent for its device, when it sent one.","type":["string","null"]},"submissions":{"anyOf":[{"type":"object","properties":{"lastMinutes":{"type":"number"},"lastDay":{"type":"number"},"lastWeek":{"type":"number"},"last2Weeks":{"type":"number"},"lastMonth":{"type":"number"}},"required":["lastMinutes","lastDay","lastWeek","last2Weeks","lastMonth"]},{"type":"null"}],"description":"Documents from this uploader in this workspace, by window."},"deviceProfiles":{"type":"array","items":{"type":"object","properties":{"deviceId":{"type":"string"},"profileId":{"type":"string"},"documentCount":{"type":"number"}},"required":["deviceId","profileId","documentCount"]},"description":"Over 30 days, inside this workspace only."},"digitalTamperingFields":{"type":"array","items":{"type":"string"}},"handwriting":{"type":"object","properties":{"handwrittenFields":{"type":"array","items":{"type":"string"}},"fullyHandwrittenFields":{"type":"array","items":{"type":"string"}},"handwrittenTamperedFields":{"type":"array","items":{"type":"string"}},"handwritingDetected":{"type":["boolean","null"]},"handwritingTamperingPresent":{"type":["boolean","null"]}},"required":["handwrittenFields","fullyHandwrittenFields","handwrittenTamperedFields","handwritingDetected","handwritingTamperingPresent"],"description":"What Claude saw written by hand, in dot notation, when a key is set and the handwriting signal is on. With no key, the lists are empty and the flags null: skipped says why."},"notADocument":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"digitalBackground":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"fraudulentPdf":{"anyOf":[{"type":"object","properties":{"fraudulentPdfCreator":{"type":["number","null"]},"textOverlay":{"type":["number","null"]},"fontMismatch":{"type":["number","null"]},"hasDigitalSignature":{"type":["boolean","null"]},"pdfModified":{"type":["number","null"]},"incrementalUpdates":{"type":["number","null"]},"incrementalChanges":{"type":"array","items":{"type":"string"}},"incrementalEdits":{"type":"array","items":{"type":"object","properties":{"page":{"type":"number"},"before":{"type":["string","null"]},"after":{"type":["string","null"]}},"required":["page","before","after"]}},"signatureCreationTools":{"type":"array","items":{"type":"string"}},"dateInversion":{"type":["number","null"]},"producerContentMismatch":{"type":["number","null"]},"writerMismatch":{"type":["number","null"]},"nullMetadata":{"type":["number","null"]},"xmpInfoMismatch":{"type":["number","null"]},"futureMetadataDate":{"type":["number","null"]},"rasterProfileMismatch":{"type":["number","null"]},"uncompressedRaster":{"type":["number","null"]},"splicedPage":{"type":["number","null"]},"splicedPageNumber":{"type":["number","null"]},"valueFontSplice":{"type":["number","null"]},"valueFontSplicePage":{"type":["number","null"]},"headlessDesktopRender":{"type":["number","null"]},"headlessRenderPlatform":{"type":["string","null"]},"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["fraudulentPdfCreator","textOverlay","fontMismatch","hasDigitalSignature","pdfModified","incrementalUpdates","incrementalChanges","incrementalEdits","signatureCreationTools","dateInversion","producerContentMismatch","writerMismatch","nullMetadata","xmpInfoMismatch","futureMetadataDate","rasterProfileMismatch","uncompressedRaster","splicedPage","splicedPageNumber","valueFontSplice","valueFontSplicePage","headlessDesktopRender","headlessRenderPlatform","doubleJpeg","firstQuantizationQuality","scrubbedProvenance","score"],"description":"Every key is always reported, so a check nothing could answer is null rather than missing."},{"type":"null"}]},"fraudulentImage":{"anyOf":[{"type":"object","properties":{"doubleJpeg":{"type":["number","null"]},"firstQuantizationQuality":{"type":["number","null"]},"scrubbedProvenance":{"type":["number","null"]},"editorSignature":{"type":["number","null"]},"editorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"editorSignatureValue":{"type":["string","null"]},"generatorSignature":{"type":["number","null"]},"generatorSignatureField":{"anyOf":[{"type":"string","enum":["icc_profile","exif:Software","exif:ProcessingSoftware","xmp:CreatorTool","png:Software","jpeg:comment"]},{"type":"null"}]},"generatorSignatureValue":{"type":["string","null"]},"generatorWriterProfile":{"type":["number","null"]},"generatorWriterProfileValue":{"type":["string","null"]},"syntheticRaster":{"type":["number","null"]},"syntheticRasterFingerprints":{"type":"array","items":{"type":"string"}},"unprofiledPng":{"type":["number","null"]},"unprofiledWebp":{"type":["number","null"]},"source":{"anyOf":[{"type":"string","enum":["original","render"]},{"type":"null"}]},"sourceFormats":{"type":"array","items":{"type":"string"}},"unreadableSource":{"type":["number","null"]},"score":{"type":["number","null"]}},"required":["doubleJpeg","firstQuantizationQuality","scrubbedProvenance","editorSignature","editorSignatureField","editorSignatureValue","generatorSignature","generatorSignatureField","generatorSignatureValue","generatorWriterProfile","generatorWriterProfileValue","syntheticRaster","syntheticRasterFingerprints","unprofiledPng","unprofiledWebp","source","sourceFormats","unreadableSource","score"]},{"type":"null"}]},"pages":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"isBlurry":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"isLcd":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]},"screenshot":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["mobile_screenshot","other_screenshot","ai_generated"]},"score":{"type":["number","null"]}},"required":["type","score"]},{"type":"null"}]},"aiGenerated":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"],"description":"Value null means nothing could say: no pixel model runs, only metadata can answer."},"glare":{"type":"object","properties":{"value":{"type":["boolean","null"]},"score":{"type":["number","null"]}},"required":["value","score"]}},"required":["index","isBlurry","isLcd","screenshot","aiGenerated","glare"]}},"skipped":{"type":"array","items":{"type":"object","properties":{"check":{"type":"string"},"reason":{"type":"string"}},"required":["check","reason"]},"description":"Checks that could not run on this file, so a clean result is not read as more than it is."}},"required":["version","score","color","types","details","attribution","decision","review","deviceId","submissions","deviceProfiles","digitalTamperingFields","handwriting","notADocument","digitalBackground","fraudulentPdf","fraudulentImage","pages","skipped"],"description":"Evidence for a reviewer. Null until inspected, and for a caller without expenses.read_all."},"DocumentMeta":{"type":"object","properties":{"totalPages":{"type":"number"},"processedPages":{"type":"number"},"ocrScore":{"description":"The average character confidence of the reading, which doubles as a measure of the image.","type":["number","null"]},"originalFileName":{"type":["string","null"]},"source":{"$ref":"#/components/schemas/DocumentSource"},"language":{"description":"BCP-47.","type":["string","null"]},"languages":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"score":{"type":"number"}},"required":["tag","score"]},"description":"Every language found, best first."},"deviceId":{"type":["string","null"]},"deviceUserUuid":{"description":"The signed-in person the device was capturing for. Null when no device was named.","type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"sourceDocuments":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Each file as submitted: name, type, size in KB, width, height and EXIF."},"owner":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]}},"required":["id","name"]},{"type":"null"}],"description":"Who uploaded it."},"duplicates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"score":{"type":"number","description":"Percent alike."}},"required":["id","url","score"]},"description":"Near copies past the workspace threshold, best first."}},"required":["totalPages","processedPages","ocrScore","originalFileName","source","language","languages","deviceId","deviceUserUuid","latitude","longitude","sourceDocuments","owner","duplicates"]},"DocumentTag":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"DomainAccessRequest":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"email":{"type":"string"},"name":{"type":["string","null"]},"status":{"type":"string","enum":["PENDING","APPROVED","DENIED"]},"createdAt":{"type":"string"}},"required":["id","userId","email","name","status","createdAt"]},"DomainAdmin":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"name":{"type":["string","null"]},"addedAt":{"type":"string"}},"required":["userId","email","name","addedAt"]},"DomainMember":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"name":{"type":["string","null"]},"membership":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"role":{"$ref":"#/components/schemas/MemberRole"},"status":{"$ref":"#/components/schemas/MemberStatus"}},"required":["id","role","status"]},{"type":"null"}],"description":"In the domain's workspace. Someone only on the address has no membership here."},"groupId":{"type":["string","null"]},"lastActiveAt":{"type":["string","null"]}},"required":["userId","email","name","membership","groupId","lastActiveAt"]},"DomainReportRow":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"name":{"type":["string","null"]},"expenseCount":{"type":"number"},"totalMinor":{"type":"number","description":"Base amounts in the workspace's currency, with voided expenses left out."}},"required":["userId","email","name","expenseCount","totalMinor"]},"DurationBucket":{"type":"object","properties":{"label":{"type":"string"},"belowMs":{"description":"Exclusive. Null for the last bucket, which has no top.","type":["number","null"]},"count":{"type":"number"}},"required":["label","belowMs","count"]},"DurationDay":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"number"},"averageMs":{"type":["number","null"]},"medianMs":{"type":["number","null"]}},"required":["date","count","averageMs","medianMs"]},"DurationSummary":{"type":"object","properties":{"count":{"type":"number","description":"How many documents the figures below are from."},"averageMs":{"type":["number","null"]},"medianMs":{"type":["number","null"]},"p90Ms":{"type":["number","null"]}},"required":["count","averageMs","medianMs","p90Ms"]},"ExpenseAccess":{"type":"object","properties":{"canEdit":{"type":"boolean"},"limited":{"type":"boolean","description":"Out for approval: only the amount, description, merchant, date, category, tags and attendees can change."},"reason":{"description":"Why it cannot be edited, or how far it can, in words for the person looking at it.","type":["string","null"]},"amountLocked":{"type":"boolean","description":"The amount is a card's own figure."},"canDelete":{"type":"boolean"},"canRestore":{"type":"boolean"},"restoreBlocked":{"description":"Why it cannot be restored: split, or merged, for good.","type":["string","null"]},"canSplit":{"type":"boolean"},"canMove":{"type":"boolean"}},"required":["canEdit","limited","reason","amountLocked","canDelete","canRestore","restoreBlocked","canSplit","canMove"]},"ExpenseFlag":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"severity":{"type":"string","enum":["info","warn","block"]},"by":{"description":"Who put it there, where that decides who may take it off.","type":"string"}},"required":["code","message","severity"]},"ExpenseGroup":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"count":{"type":"number"},"baseAmountMinor":{"type":"number"}},"required":["key","label","count","baseAmountMinor"]},"ExpenseSummary":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"reference":{"type":"string"},"status":{"$ref":"#/components/schemas/ExpenseStatus"},"kind":{"$ref":"#/components/schemas/ExpenseKind"},"merchantName":{"type":["string","null"]},"tripTitle":{"description":"For a trip, what to call it in a list.","type":["string","null"]},"description":{"type":["string","null"]},"date":{"type":"string"},"currency":{"type":"string"},"amountMinor":{"type":"number"},"baseAmountMinor":{"type":"number"},"taxMinor":{"type":["number","null"]},"category":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"alsoCategories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"description":"Further categories it can be found under. Its money stays in category."},"project":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":["string","null"]}},"required":["id","name","code"]},{"type":"null"}]},"client":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},{"type":"null"}]},"owner":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"moneyFlow":{"type":"string","enum":["IN","OUT"],"description":"Which way the money went."},"invoiceNumber":{"type":["string","null"]},"matched":{"type":"boolean","description":"A card charge has been matched to it."},"connectedApps":{"type":"array","items":{"type":"string"},"description":"Connected services it has been posted to."},"reportId":{"type":["string","null"]},"externalId":{"description":"A developer's own reference, exactly as sent.","type":["string","null"]},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"paymentType":{"anyOf":[{"$ref":"#/components/schemas/PaymentType"},{"type":"null"}]},"confidence":{"type":["number","null"]},"flags":{"type":"array","items":{"$ref":"#/components/schemas/ExpenseFlag"}},"reviewFields":{"type":"array","items":{"type":"string"}},"thumbnailUrl":{"type":["string","null"]},"documentId":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":["string","null"]}},"required":["id","name","color"]}},"attendeeCount":{"type":"number"},"fxRate":{"type":"number","description":"What one unit of the expense currency is worth in the base currency."},"held":{"type":"boolean","description":"Held back from its report until someone releases it."},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","number","reference","status","kind","merchantName","tripTitle","description","date","currency","amountMinor","baseAmountMinor","taxMinor","category","alsoCategories","project","client","owner","moneyFlow","invoiceNumber","matched","connectedApps","reportId","externalId","billable","reimbursable","paymentType","confidence","flags","reviewFields","thumbnailUrl","documentId","tags","attendeeCount","fxRate","held","createdAt","updatedAt"]},"ExplainCall":{"type":"object","properties":{"tool":{"type":"string"},"effect":{"type":"string","enum":["READ","WRITE"]},"outcome":{"type":"string","enum":["FAILED","PROPOSED","EXECUTED","REFUSED"]},"input":{},"reason":{"type":["string","null"]},"at":{"type":"string"}},"required":["tool","effect","outcome","input","reason","at"]},"ExportCapabilities":{"type":"object","properties":{"reimbursable":{"type":"array","items":{"type":"string","enum":["BILL","CHECK","JOURNAL_ENTRY","EXPENSE_REPORT"]}},"companyCard":{"type":"array","items":{"type":"string","enum":["BILL","JOURNAL_ENTRY","EXPENSE_REPORT","CREDIT_CARD","DEBIT_CARD"]}},"billStatus":{"type":"boolean","description":"Xero alone lets an entry arrive as a draft."},"paidSync":{"type":"boolean","description":"Reads Paid back, and posts a bill payment."},"originalCurrency":{"type":"boolean","description":"Posts the original currency with its rate."}},"required":["reimbursable","companyCard","billStatus","paidSync","originalCurrency"]},"ExportFilters":{"type":"object","properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/ExpenseStatus"},{"type":"array","items":{"$ref":"#/components/schemas/ExpenseStatus"}}]},"kind":{"$ref":"#/components/schemas/ExpenseKind"},"paymentType":{"$ref":"#/components/schemas/PaymentType"},"ownerId":{"type":"string"},"scope":{"default":"all","type":"string","enum":["mine","all"]},"categoryId":{"type":"string"},"merchantId":{"type":"string"},"projectId":{"type":"string"},"clientId":{"type":"string"},"tagId":{"type":"string"},"department":{"type":"string","maxLength":120},"reportId":{"type":"string"},"externalId":{"type":"string","maxLength":200},"unreported":{"type":"boolean"},"needsReview":{"type":"boolean"},"billable":{"type":"boolean"},"reimbursable":{"type":"boolean"},"moneyFlow":{"type":"string","enum":["IN","OUT"]},"dateField":{"$ref":"#/components/schemas/ExpenseDateField"},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"minMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"maxMinor":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"q":{"type":"string","maxLength":200},"ids":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string"}},"year":{"type":"integer","minimum":2000,"maximum":2100},"reportState":{"anyOf":[{"$ref":"#/components/schemas/ReportStatus"},{"minItems":1,"type":"array","items":{"$ref":"#/components/schemas/ReportStatus"}}]},"reportIds":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"string","minLength":1}},"startDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"approvedAfter":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"exported":{"type":"boolean"},"categoryIds":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","minLength":1}},"documentIds":{"minItems":1,"maxItems":5000,"type":"array","items":{"type":"string","minLength":1}},"documentTypes":{"minItems":1,"maxItems":20,"type":"array","items":{"$ref":"#/components/schemas/DocumentType"}},"policyIds":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string","minLength":1}},"approvalLinkId":{"type":"string"},"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":80},"formula":{"type":"string","maxLength":500}},"required":["key"]}},"columnSet":{"$ref":"#/components/schemas/DocumentColumnSet"},"preset":{"$ref":"#/components/schemas/ExportPreset"},"view":{"type":"object","properties":{"level":{"default":"expense","type":"string","enum":["expense","report"]},"columns":{"minItems":1,"maxItems":60,"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string","minLength":1,"maxLength":80}},"required":["key"]}},"sort":{"$ref":"#/components/schemas/ExpenseSort"},"groupBy":{"$ref":"#/components/schemas/ExpenseGroupBy"},"groupsOnly":{"type":"boolean"}},"required":["columns"]},"notifyRequester":{"type":"boolean"},"fullPageReceipts":{"type":"boolean"},"template":{"type":"string"},"emailMessage":{"type":"string"},"delimiter":{"$ref":"#/components/schemas/CsvDelimiter"},"bom":{"type":"boolean"},"recipients":{"maxItems":10,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"scheduledReportId":{"type":"string"},"scheduledReportName":{"type":"string"},"notes":{"type":"array","items":{"type":"string"}}}},"ExportFinish":{"type":"object","properties":{"markAsExported":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["PENDING","DONE","FAILED","SKIPPED"]},"marked":{"type":"array","items":{"type":"string"},"description":"The reports this export marked, by reference."},"skipped":{"type":"array","items":{"type":"object","properties":{"reference":{"type":"string"},"reason":{"type":"string"}},"required":["reference","reason"]},"description":"The reports it left as they were, and why."},"error":{"type":["string","null"]}},"required":["state","marked","skipped","error"]},{"type":"null"}]},"sftpUpload":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["PENDING","DONE","FAILED","SKIPPED"]},"host":{"type":"string"},"port":{"type":"number"},"path":{"type":"string"},"attempts":{"type":"number"},"file":{"description":"Where the file landed on the server.","type":["string","null"]},"error":{"type":["string","null"]},"uploadedAt":{"type":["string","null"]}},"required":["state","host","port","path","attempts","file","error","uploadedAt"]},{"type":"null"}],"description":"Where the file went. The credentials are never returned."}},"required":["markAsExported","sftpUpload"]},"ExportRecord":{"type":"object","properties":{"id":{"type":"string"},"documentId":{"type":["string","null"]},"expenseId":{"type":["string","null"]},"target":{"type":"string","description":"A service, such as QUICKBOOKS_ONLINE, a file format, such as CSV, or what a program named."},"externalId":{"description":"The id it has there.","type":["string","null"]},"exportJobId":{"type":["string","null"]},"via":{"type":"string","enum":["EXPORT","SYNC","API"]},"createdAt":{"type":"string"}},"required":["id","documentId","expenseId","target","externalId","exportJobId","via","createdAt"]},"HeldBackRow":{"type":"object","properties":{"postedDate":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"description":{"type":"string"},"matchedDescription":{"type":"string"},"matchedFormat":{"type":"string","enum":["CSV","IIF","OFX"]}},"required":["postedDate","amountMinor","currency","description","matchedDescription","matchedFormat"]},"HrCredentialField":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"secret":{"type":"boolean","description":"A secret never comes back once saved."},"hint":{"type":"string"},"pattern":{"description":"A regular expression the value has to match.","type":"string"}},"required":["key","label","secret"]},"HrSystem":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"access":{"type":"string","enum":["DIRECT","PARTNER","FILE"],"description":"DIRECT reads the system with credentials you supply. PARTNER needs an agreement with the vendor first, so it works by file until then. FILE is a CSV, a webhook or a file drop."},"fields":{"type":"array","items":{"$ref":"#/components/schemas/HrCredentialField"},"description":"What connecting asks for."},"partnerNote":{"type":"string"}},"required":["key","name","access","fields"]},"ImportCounts":{"type":"object","properties":{"categories":{"type":"number"},"tags":{"type":"number"},"reportFields":{"type":"number"},"taxRates":{"type":"number"}},"required":["categories","tags","reportFields","taxRates"]},"ImportDimension":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"count":{"type":"number","description":"Live values in this list at the provider."},"destinations":{"type":"array","items":{"type":"string","enum":["OFF","TAGS","REPORT_FIELDS","EMPLOYEE_DEFAULT"]}},"destination":{"type":"string","enum":["OFF","TAGS","REPORT_FIELDS","EMPLOYEE_DEFAULT"]}},"required":["key","label","count","destinations","destination"]},"ImportSummary":{"type":"object","properties":{"at":{"type":"string"},"created":{"description":"New rows this run made.","$ref":"#/components/schemas/ImportCounts"},"paired":{"type":"number","description":"Rows already here that were paired, untouched."},"updated":{"type":"number","description":"Rows brought up to date because the provider changed and nobody had touched them."},"keptEdits":{"type":"number","description":"Rows a person changed or deleted, left as they are."},"skipped":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":"string"}},"required":["name","reason"]},"description":"Accounts left out, with the reason."}},"required":["at","created","paired","updated","keptEdits","skipped"]},"InboundEmail":{"type":"object","properties":{"id":{"type":"string"},"from":{"type":"string"},"subject":{"type":["string","null"]},"status":{"type":"string","enum":["RECEIVED","PROCESSED","NO_ATTACHMENT","UNKNOWN_SENDER","OVER_LIMIT","REJECTED","FAILED"]},"detail":{"type":["string","null"]},"documentCount":{"type":"number"},"hasAttachment":{"type":"boolean"},"refusedFiles":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"reason":{"type":"string"}},"required":["name","reason"]}},"receivedAt":{"type":"string"}},"required":["id","from","subject","status","detail","documentCount","hasAttachment","refusedFiles","receivedAt"]},"InboxTodo":{"type":"object","properties":{"key":{"type":"string"},"title":{"type":"string"},"detail":{"type":["string","null"]},"href":{"type":"string"},"count":{"type":"number","description":"How many of these there are, for a line that stands for several."}},"required":["key","title","detail","href","count"]},"InvoiceDisplayStatus":{"type":"string","enum":["DRAFT","SENT","VIEWED","PARTIALLY_PAID","PAID","VOID","OVERDUE"],"description":"The status, or OVERDUE once the due date has passed with money still owed."},"InvoiceLine":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"quantity":{"type":"number"},"unitMinor":{"type":"number"},"amountMinor":{"type":"number"},"taxKind":{"anyOf":[{"$ref":"#/components/schemas/InvoiceTaxKind"},{"type":"null"}]},"taxBasisPoints":{"description":"2000 is 20%.","type":["number","null"]},"taxMinor":{"type":"number"},"receiptUrl":{"description":"The receipt of a pulled-in expense: a signed link that lasts 15 minutes.","type":["string","null"]},"expenseId":{"type":["string","null"]}},"required":["id","description","quantity","unitMinor","amountMinor","taxKind","taxBasisPoints","taxMinor","receiptUrl","expenseId"]},"InvoiceMessage":{"type":"object","properties":{"id":{"type":"string"},"fromRecipient":{"type":"boolean"},"authorName":{"type":["string","null"]},"body":{"type":"string"},"createdAt":{"type":"string"}},"required":["id","fromRecipient","authorName","body","createdAt"]},"InvoicePayment":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["PAYMENT","REFUND"]},"amountMinor":{"type":"number"},"paidOn":{"type":"string"},"reference":{"type":["string","null"]},"note":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","kind","amountMinor","paidOn","reference","note","createdAt"]},"InvoiceSummary":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"reference":{"type":"string","description":"INV- and the number."},"status":{"$ref":"#/components/schemas/InvoiceStatus"},"displayStatus":{"$ref":"#/components/schemas/InvoiceDisplayStatus"},"title":{"type":["string","null"]},"recipientName":{"type":["string","null"]},"recipientEmail":{"type":["string","null"]},"recipientPhone":{"type":["string","null"]},"currency":{"type":"string"},"issueDate":{"type":"string"},"dueDate":{"type":["string","null"]},"totalMinor":{"type":"number"},"paidMinor":{"type":"number"},"refundedMinor":{"type":"number"},"balanceMinor":{"type":"number","description":"What is still owed: the total, less payments, plus anything refunded."},"sentAt":{"type":["string","null"]},"viewedAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","number","reference","status","displayStatus","title","recipientName","recipientEmail","recipientPhone","currency","issueDate","dueDate","totalMinor","paidMinor","refundedMinor","balanceMinor","sentAt","viewedAt","paidAt","createdAt"]},"InvoiceToPay":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"displayStatus":{"$ref":"#/components/schemas/InvoiceDisplayStatus"},"senderName":{"type":"string"},"senderEmail":{"type":["string","null"]},"title":{"type":["string","null"]},"currency":{"type":"string"},"dueDate":{"type":["string","null"]},"totalMinor":{"type":"number"},"balanceMinor":{"type":"number"},"awaitingPayment":{"type":"boolean"}},"required":["id","reference","displayStatus","senderName","senderEmail","title","currency","dueDate","totalMinor","balanceMinor","awaitingPayment"]},"JoinRequest":{"type":"object","properties":{"id":{"type":"string"},"userId":{"type":"string"},"email":{"type":"string"},"name":{"type":["string","null"]},"source":{"type":"string","enum":["DOMAIN","LINK"]},"role":{"$ref":"#/components/schemas/MemberRole"},"status":{"type":"string","enum":["PENDING","APPROVED","DENIED"]},"createdAt":{"type":"string"}},"required":["id","userId","email","name","source","role","status","createdAt"]},"JoinableWorkspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"mode":{"type":"string","enum":["ASK","JOIN_NOW"]}},"required":["id","name","mode"]},"MailInDocument":{"type":"object","properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/DocumentType"},"status":{"$ref":"#/components/schemas/DocumentStatus"},"originalFilename":{"type":["string","null"]},"thumbnailUrl":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","type","status","originalFilename","thumbnailUrl","createdAt"]},"MailInEnvelopeAllowance":{"type":"object","properties":{"week":{"type":"string","description":"2026-W44. A week starts on Monday, UTC."},"weekLimit":{"type":"number","description":"Envelopes a workspace can have sent in a week."},"used":{"type":"number"},"remaining":{"type":"number","description":"Envelopes that can still be requested this week."}},"required":["week","weekLimit","used","remaining"]},"MappingOption":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":["string","null"]},"type":{"description":"The account type, or the tracking category an option belongs to.","type":["string","null"]},"active":{"type":"boolean"}},"required":["id","name","code","type","active"]},"MappingRow":{"type":"object","properties":{"entity":{"$ref":"#/components/schemas/MappingEntity"},"localId":{"type":"string"},"name":{"type":"string"},"code":{"type":["string","null"]},"kind":{"type":"string","enum":["ACCOUNT","PAYMENT_ACCOUNT","VENDOR","CUSTOMER","CLASS","TRACKING","TAX_CODE","ITEM","LOCATION","DEPARTMENT","EMPLOYEE","CUSTOM_DIMENSION","EXPENSE_CATEGORY","PAYABLE_ACCOUNT"]},"required":{"type":"boolean","description":"Posting stops at this row while it is empty."},"mapped":{"anyOf":[{"$ref":"#/components/schemas/MappingOption"},{"type":"null"}]},"suggestion":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":["string","null"]},"type":{"description":"The account type, or the tracking category an option belongs to.","type":["string","null"]},"active":{"type":"boolean"},"reason":{"type":"string","enum":["name","code","similar"]}},"required":["id","name","code","type","active","reason"]},{"type":"null"}],"description":"Never used for posting until someone saves it."}},"required":["entity","localId","name","code","kind","required","mapped","suggestion"]},"McpError":{"type":"object","properties":{"jsonrpc":{"type":"string","const":"2.0"},"id":{"type":["string","number"]},"error":{"type":"object","properties":{"code":{"type":"number"},"message":{"type":"string"},"data":{}},"required":["code","message"]}},"required":["jsonrpc","error"]},"McpResult":{"type":"object","properties":{"jsonrpc":{"type":"string","const":"2.0"},"id":{"type":["string","number"]},"result":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["jsonrpc","id","result"]},"MemberChoice":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"MessageFlag":{"type":"object","properties":{"id":{"type":"string"},"message":{"$ref":"#/components/schemas/Message"},"room":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"reason":{"type":["string","null"]},"source":{"type":"string","enum":["PERSON","SCAN"]},"reporter":{"anyOf":[{"$ref":"#/components/schemas/ChatPerson"},{"type":"null"}]},"state":{"type":"string","enum":["OPEN","UPHELD","DISMISSED"]},"createdAt":{"type":"string"}},"required":["id","message","room","reason","source","reporter","state","createdAt"]},"MileageLogMonth":{"type":"object","properties":{"month":{"type":"string","description":"YYYY-MM."},"trips":{"type":"number"},"amountMinor":{"type":"number"}},"required":["month","trips","amountMinor"]},"MoneyPerson":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"NamedWorkspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"NotificationPreference":{"type":"object","properties":{"type":{"type":"string","enum":["invoice.updated","document.processed","document.failed","expense.needs_review","report.submitted","report.approved","report.rejected","report.reimbursed","comment.added","member.invited","billing.payment_failed","billing.dispute_opened","billing.trial_ending","usage.limit_near","budget.threshold","fraud.duplicate_spike","integration.needs_attention","integration.post_failed","integration.batch_finished","mail_in.updated","chat.message","chat.mention","task.assigned","assistant.action","document.share_requested","export.ready","webhook.disabled","release.published","digest.daily"]},"email":{"type":"boolean"},"push":{"type":"boolean"},"inApp":{"type":"boolean"}},"required":["type","email","push","inApp"]},"OAuthConnection":{"type":"object","properties":{"id":{"type":"string"},"clientName":{"type":"string"},"clientUri":{"type":["string","null"]},"workspaceId":{"type":"string"},"workspaceName":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"resource":{"type":"string","enum":["api","mcp"]},"connectedAt":{"type":"string"},"lastUsedAt":{"type":["string","null"]}},"required":["id","clientName","clientUri","workspaceId","workspaceName","scopes","resource","connectedAt","lastUsedAt"]},"OAuthScope":{"type":"object","properties":{"scope":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"},"optIn":{"type":"boolean","description":"Off until the person ticks it. Ticking it is the rule they approve."}},"required":["scope","label","description","optIn"]},"OffboardingItem":{"type":"object","properties":{"step":{"type":"string","enum":["transfer_ownership","share_bank_account","reset_payer","reconnect_integrations"]},"done":{"type":"boolean"},"detail":{"type":"string"},"href":{"type":"string"}},"required":["step","done","detail","href"]},"OutstandingPayee":{"type":"object","properties":{"payee":{"$ref":"#/components/schemas/MoneyPerson"},"employeeId":{"type":["string","null"]},"unbatchedMinor":{"type":"number","description":"Approved and not yet in a batch: these can go into one now."},"batchedMinor":{"type":"number","description":"In a live batch, waiting to be marked paid."},"totalMinor":{"type":"number"},"hasBankAccount":{"type":"boolean"},"reports":{"type":"array","items":{"$ref":"#/components/schemas/OutstandingReport"}}},"required":["payee","employeeId","unbatchedMinor","batchedMinor","totalMinor","hasBankAccount","reports"]},"OutstandingReport":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"title":{"type":"string"},"approvedAt":{"type":["string","null"]},"amountMinor":{"type":"number"},"reimbursementId":{"description":"The live batch holding this report, if there is one.","type":["string","null"]},"currency":{"type":"string","description":"What the report is written in."},"reimbursementReference":{"type":["string","null"]}},"required":["id","reference","title","approvedAt","amountMinor","reimbursementId","currency","reimbursementReference"]},"PlanLimits":{"type":"object","properties":{"scansPerMonth":{"type":"number","description":"Documents extracted per calendar month."},"seatsIncluded":{"type":"number","description":"Members included in the price."},"maxSeats":{"description":"Most members a workspace may have. Null is unlimited.","type":["number","null"]},"apiDocumentsPerMonth":{"type":"number","description":"Documents accepted through the developer API per month."},"mailInDocumentsPerMonth":{"type":"number","description":"Paper documents per month through the mail-in service."}},"required":["scansPerMonth","seatsIncluded","maxSeats","apiDocumentsPerMonth","mailInDocumentsPerMonth"]},"PolicyDocument":{"type":"object","properties":{"key":{"type":"string"},"filename":{"type":"string"},"uploadedAt":{"type":"string"}},"required":["key","filename","uploadedAt"]},"PolicyFinding":{"type":"object","properties":{"code":{"type":"string","const":"POLICY_VIOLATION"},"ruleId":{"type":"string"},"type":{"$ref":"#/components/schemas/PolicyRuleType"},"severity":{"$ref":"#/components/schemas/PolicySeverity"},"expenseId":{"type":"string"},"expenseReference":{"type":"string"},"message":{"type":"string"},"reviewerOnly":{"description":"Evidence for a reviewer. It never reaches the person who uploaded the receipt.","type":"boolean"}},"required":["code","ruleId","type","severity","expenseId","expenseReference","message"]},"PostingPause":{"type":"object","properties":{"since":{"type":"string"},"code":{"type":"string","description":"Stable code of the failure that paused it."},"message":{"type":"string","description":"Written for a person."},"failed":{"type":"number","description":"Records waiting on a person now."}},"required":["since","code","message","failed"]},"PrivateDetails":{"type":"object","properties":{"legalFirstName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"legalLastName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"dateOfBirth":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"addressLine1":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"addressLine2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"region":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"country":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]}},"required":["legalFirstName","legalLastName","dateOfBirth","phone","addressLine1","addressLine2","city","region","postalCode","country"]},"ReimbursementReport":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"amountMinor":{"type":"number"}},"required":["id","reference","title","status","amountMinor"]},"ReleaseNote":{"type":"object","properties":{"id":{"type":"string"},"version":{"type":"string"},"product":{"$ref":"#/components/schemas/ReleaseProduct"},"environments":{"type":"array","items":{"$ref":"#/components/schemas/ReleaseEnvironment"}},"title":{"type":"string"},"body":{"type":"string"},"publishedAt":{"type":"string"}},"required":["id","version","product","environments","title","body","publishedAt"]},"ReportArchive":{"type":"object","properties":{"id":{"type":"string"},"workspaceName":{"type":"string"},"reportCount":{"type":"number"},"closedAt":{"type":"string"}},"required":["id","workspaceName","reportCount","closedAt"]},"ReportFieldValue":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/ReportFieldType"},"options":{"type":"array","items":{"type":"string"}},"formula":{"type":["string","null"]},"required":{"type":"boolean"},"enabled":{"type":"boolean"},"position":{"type":"number"},"disabledOptions":{"description":"List values turned off: kept on reports that hold them, and not offered for new ones.","type":"array","items":{"type":"string"}},"imported":{"description":"Came from the connected books, so it cannot be deleted and its values only turn on and off.","type":"boolean"},"value":{"type":["string","null"]}},"required":["id","name","type","options","formula","required","enabled","position","value"]},"ReportPerson":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"}},"required":["id","name","email"]},"ReportSummary":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"number"},"reference":{"type":"string"},"title":{"type":"string"},"status":{"$ref":"#/components/schemas/ReportStatus"},"stage":{"type":"string","enum":["DRAFT","SUBMITTED","OUTSTANDING","APPROVED","REJECTED","PAID","EXPORTED","DONE"],"description":"Submitted until someone has acted on it. Outstanding once it is part way: under review, with a hold, or partly approved."},"paymentStage":{"anyOf":[{"type":"string","enum":["MARKED_AS_PAID","WITHDRAWING","CONFIRMED"]},{"type":"null"}]},"owner":{"$ref":"#/components/schemas/ReportPerson"},"currency":{"type":"string"},"totalMinor":{"type":"number"},"reimbursableMinor":{"type":"number"},"expenseCount":{"type":"number"},"findingCount":{"type":"number"},"periodStart":{"type":["string","null"]},"periodEnd":{"type":["string","null"]},"autoCreated":{"type":"boolean"},"waitingOn":{"type":"array","items":{"$ref":"#/components/schemas/ReportPerson"},"description":"Who the report is with right now."},"submittedAt":{"type":["string","null"]},"approvedAt":{"type":["string","null"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","number","reference","title","status","stage","paymentStage","owner","currency","totalMinor","reimbursableMinor","expenseCount","findingCount","periodStart","periodEnd","autoCreated","waitingOn","submittedAt","approvedAt","createdAt","updatedAt"]},"ReportTimelineEntry":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string"},"actor":{"anyOf":[{"$ref":"#/components/schemas/ReportPerson"},{"type":"null"}],"description":"Null when PaperTotal did it on a schedule."},"onBehalfOf":{"anyOf":[{"$ref":"#/components/schemas/ReportPerson"},{"type":"null"}],"description":"The person whose name this was done in, when the actor was covering for them."},"detail":{"description":"The reason, comment or note that came with the action.","type":["string","null"]},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"at":{"type":"string"}},"required":["id","action","actor","onBehalfOf","detail","metadata","at"]},"ReviewRow":{"type":"object","properties":{"expenseId":{"type":"string"},"reference":{"type":"string"},"merchantName":{"type":["string","null"]},"date":{"type":"string"},"amountMinor":{"type":"number"},"currency":{"type":"string"},"taxMinor":{"type":["number","null"]},"categoryId":{"type":["string","null"]},"account":{"description":"Where the category posts, when it has been mapped.","type":["string","null"]},"posted":{"type":"boolean","description":"Already in the books. Selected only when the person asks to send it again."},"problem":{"description":"What would stop it posting, in a sentence.","type":["string","null"]},"gst":{"anyOf":[{"type":"string","enum":["MISSING","OVER"]},{"type":"null"}]}},"required":["expenseId","reference","merchantName","date","amountMinor","currency","taxMinor","categoryId","account","posted","problem","gst"]},"RoomMember":{"type":"object","properties":{"phone":{"type":["string","null"]},"agent":{"description":"True for an agent's account, so a client never reads it as a person.","type":"boolean"},"id":{"type":"string"},"name":{"type":["string","null"]},"email":{"type":"string"},"moderator":{"type":"boolean"}},"required":["id","name","email","moderator"]},"S3Access":{"type":"object","properties":{"configured":{"type":"boolean"},"accessKeyId":{"type":["string","null"]},"region":{"type":["string","null"]}},"required":["configured","accessKeyId","region"]},"ScimToken":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"lastUsedAt":{"type":["string","null"]},"expiresAt":{"type":["string","null"]},"createdAt":{"type":"string"}},"required":["id","name","prefix","lastUsedAt","expiresAt","createdAt"]},"SealedValue":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/SensitiveKind"},"masked":{"type":"string","description":"All but the last few characters are stars. Punctuation stays where it was."},"field":{"type":["string","null"]},"page":{"type":"number"}},"required":["kind","masked","field","page"]},"SearchGroup":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/SearchKind"},"hits":{"type":"array","items":{"$ref":"#/components/schemas/SearchHit"}},"hasMore":{"type":"boolean"}},"required":["kind","hits","hasMore"]},"SearchHit":{"type":"object","properties":{"kind":{"$ref":"#/components/schemas/SearchKind"},"id":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":["string","null"]},"snippet":{"type":"array","items":{"$ref":"#/components/schemas/SearchSnippetPart"}},"date":{"type":["string","null"]},"amountMinor":{"type":["number","null"]},"currency":{"type":["string","null"]},"status":{"type":["string","null"]},"documentType":{"anyOf":[{"$ref":"#/components/schemas/DocumentType"},{"type":"null"}]},"thumbnailUrl":{"type":["string","null"]},"roomId":{"description":"The chat a message or a task is in, which is where it opens. Null for every other kind.","type":["string","null"]}},"required":["kind","id","title","subtitle","snippet","date","amountMinor","currency","status","documentType","thumbnailUrl","roomId"]},"SearchShortcutReport":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"totalMinor":{"type":"number"},"currency":{"type":"string"},"ownerName":{"type":"string"},"workspaceId":{"type":"string"},"workspaceName":{"type":"string"},"date":{"type":"string","description":"When it was submitted, or created if it never was."}},"required":["id","reference","title","status","totalMinor","currency","ownerName","workspaceId","workspaceName","date"]},"SearchSnippetPart":{"type":"object","properties":{"text":{"type":"string"},"match":{"type":"boolean","description":"This part is what matched."}},"required":["text","match"]},"SearchSummaryRow":{"type":"object","properties":{"key":{"type":"string","description":"Stable within this summary."},"label":{"type":"string"},"count":{"type":"number"},"totalMinor":{"type":"number"}},"required":["key","label","count","totalMinor"]},"SearchSummary":{"type":"object","properties":{"groupBy":{"type":"string","enum":["card","from","week","month","quarter","year","merchant","withdrawal-id","category","tag"]},"view":{"type":"string","enum":["table","bar","pie","line"]},"currency":{"type":"string"},"convertedFrom":{"description":"Set when `group-currency:` converted the totals: the currency they were in, at the latest rate.","type":["string","null"]},"rows":{"type":"array","items":{"$ref":"#/components/schemas/SearchSummaryRow"}},"count":{"type":"number","description":"Every match once, even when `group-by:tag` counts an expense under each of its tags."},"totalMinor":{"type":"number"},"truncated":{"type":"boolean","description":"There are more groups than `rows` holds."}},"required":["groupBy","view","currency","convertedFrom","rows","count","totalMinor","truncated"]},"ServiceProvider":{"type":"object","properties":{"entityId":{"type":"string"},"acsUrl":{"type":"string"},"binding":{"type":"string","const":"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"},"nameIdFormat":{"type":"string","const":"urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"},"metadataPath":{"type":"string"},"redirectUri":{"type":"string","description":"Where an OIDC provider sends people back."}},"required":["entityId","acsUrl","binding","nameIdFormat","metadataPath","redirectUri"]},"Session":{"type":"object","properties":{"id":{"type":"string"},"deviceName":{"type":["string","null"]},"os":{"type":["string","null"]},"browser":{"type":["string","null"]},"provider":{"type":["string","null"]},"secondFactor":{"type":["string","null"]},"signedInAt":{"type":"string"},"lastSeenAt":{"type":"string"},"current":{"type":"boolean","description":"The sign-in behind this request."}},"required":["id","deviceName","os","browser","provider","secondFactor","signedInAt","lastSeenAt","current"]},"SignInProvider":{"type":"object","properties":{"providerId":{"type":"string"},"protocol":{"$ref":"#/components/schemas/SsoProtocol"},"displayName":{"type":"string"}},"required":["providerId","protocol","displayName"]},"SkippedExpense":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string"}},"required":["id","reason"]},"SlackChannel":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"isPrivate":{"type":"boolean"}},"required":["id","name","isPrivate"]},"StatementOutputRow":{"type":"object","properties":{"postedDate":{"type":"string"},"description":{"type":"string"},"merchantName":{"type":["string","null"]},"amountMinor":{"type":"number"},"currency":{"type":"string"},"card":{"description":"Which card, for a file holding several.","type":["string","null"]}},"required":["postedDate","description","merchantName","amountMinor","currency","card"]},"StatusComponent":{"type":"object","properties":{"component":{"type":"string","enum":["api","web","worker"]},"name":{"type":"string"},"state":{"type":"string","enum":["up","down","not_measured"]},"lastCheckedAt":{"type":["string","null"]},"latencyMs":{"type":["number","null"]},"uptime":{"type":"array","items":{"type":"object","properties":{"days":{"type":"number"},"percent":{"type":["number","null"]}},"required":["days","percent"]},"description":"Over the last N days, or as much of them as has been measured. Null when nothing has."},"days":{"type":"array","items":{"$ref":"#/components/schemas/StatusDay"}}},"required":["component","name","state","lastCheckedAt","latencyMs","uptime","days"]},"StatusDay":{"type":"object","properties":{"date":{"type":"string"},"percent":{"description":"Null for a day with nothing measured.","type":["number","null"]}},"required":["date","percent"]},"StatusIncident":{"type":"object","properties":{"component":{"type":"string","enum":["api","web","worker"]},"name":{"type":"string"},"startedAt":{"type":"string"},"endedAt":{"description":"Null while it is still going on.","type":["string","null"]}},"required":["component","name","startedAt","endedAt"]},"StorageFeature":{"type":"object","properties":{"enabled":{"type":"boolean"},"folder":{"description":"Where it goes, once the first pass has made the folder.","type":["string","null"]},"done":{"type":"number","description":"Written to the folder, or brought in from it."},"skipped":{"type":"number","description":"Files the provider or the capture rules refused for good."}},"required":["enabled","folder","done","skipped"]},"StorageIntake":{"type":"object","properties":{"watch":{"type":"string","enum":["READY","NEEDS_GRANT","NOT_OFFERED"],"description":"READY watches. NEEDS_GRANT is one reconnect away. NOT_OFFERED cannot be turned on."},"unavailable":{"description":"Why it cannot be turned on, written for a person.","type":["string","null"]},"recentSkips":{"type":"array","items":{"type":"string"},"description":"The latest files that did not come in, each with its reason."},"enabled":{"type":"boolean"},"folder":{"description":"Where it goes, once the first pass has made the folder.","type":["string","null"]},"done":{"type":"number","description":"Written to the folder, or brought in from it."},"skipped":{"type":"number","description":"Files the provider or the capture rules refused for good."}},"required":["watch","unavailable","recentSkips","enabled","folder","done","skipped"]},"StoreSubscriptionNotice":{"type":"object","properties":{"workspaceId":{"type":"string"},"workspaceName":{"type":"string"},"store":{"type":"string","enum":["APP_STORE","PLAY_STORE"]}},"required":["workspaceId","workspaceName","store"]},"SuggestedAgentRule":{"type":"object","properties":{"key":{"type":"string"},"list":{"description":"The list in its first condition is the workspace's to choose, and this names it on the screen.","type":"string"},"group":{"type":"string","enum":["Amount, category and merchant","Currency, tax, tag and description","Dates and report shape","Receipt intelligence"]},"title":{"type":"string"},"prompt":{"type":"string"},"plan":{"type":"object","properties":{"events":{"type":"array","items":{"type":"string","enum":["report.submitted","report.auto_approved","report.step_approved","report.approved","report.rejected","report.retracted","report.reopened","report.sent_back","report.expense_rejected","report.findings_accepted","expense.held","expense.released","report.created","report.updated","report.deleted","report.reassigned","report.closed","report.held_moved","report.expenses_added","report.expense_removed","report.approver_replaced","report.audit_sampled","report.moved","reimbursement.created","reimbursement.paid","report.reimbursed","reimbursement.failed","reimbursement.reversed","reimbursement.cancelled","reimbursement.overpaid","reimbursement.receipt_confirmed","reimbursement.delayed","reimbursement.returned","expense.reimbursement_stopped","expense.created","expense.updated","expense.voided","expense.restored","expense.split","expense.duplicate_kept","expense.receipt_merged","expense.receipt_attached","expense.receipt_replaced","expense.corrected","expense.violation_dismissed","document.created","document.deleted","document.processed","document.failed","comment.added","comment.mentioned","report.participant_added","report.participant_removed","room.member_added","room.member_removed","task.created","task.reassigned","task.completed","task.reopened","document.shared","payment_account.assigned","payment_account.unassigned","payment_account.created","payment_account.archived","plaid.connected","plaid.reconnected","plaid.removed","card.feed_broken","transaction.matched","transaction.unmatched","report.exported","export.requested","integration.sync_failed","integration.needs_attention","travel.trip_changed","billing.subscription_changed","billing.seats_changed","member.role_changed","member.suspended","member.updated","invitation.created","invitation.accepted","workflow.created","workflow.updated","workflow.deleted","policy.created","policy.updated","policy.deleted","budget.created","budget.updated","budget.deleted","integration.connected","integration.disconnected","payee_bank_account.saved","payee_bank_account.removed","reimbursement.settings_saved"]}},"branches":{"type":"array","items":{"type":"object","properties":{"when":{"type":"array","items":{"type":"object","properties":{"field":{"$ref":"#/components/schemas/AgentField"},"op":{"$ref":"#/components/schemas/AgentOperator"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"array","items":{"type":"string"}},{"type":"array","prefixItems":[{"type":"number"},{"type":"number"}],"items":false,"minItems":2,"maxItems":2},{"type":"boolean"}]}},"required":["field","op","value"]}},"then":{"type":"array","items":{"type":"object","properties":{"tool":{"$ref":"#/components/schemas/AgentStepTool"},"input":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","number","boolean","null"]},"description":"Fixed when a person approved the rule. The subject is always what the event was about, so a step names no record."}},"required":["tool","input"]}},"ask":{"description":"A yes-or-no question a condition cannot settle. A reader with no tools answers it, and only a person can then write.","type":"string"}},"required":["when","then"]},"description":"The first branch whose conditions hold is the one that runs, so \"and all other reports\" is a last branch with none."}},"required":["events","branches"]},"needsClaude":{"type":"boolean","description":"Needs Claude to run, and whatever it decides waits for a person."}},"required":["key","group","title","prompt","plan","needsClaude"]},"TaxCategory":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"deductiblePct":{"type":"number"},"count":{"type":"number"},"spentMinor":{"type":"number"},"deductibleMinor":{"type":"number"}},"required":["id","name","deductiblePct","count","spentMinor","deductibleMinor"]},"TaxLine":{"type":"object","properties":{"line":{"type":"string","description":"The Schedule C line: \"9\", \"24b\"."},"label":{"type":"string"},"count":{"type":"number"},"spentMinor":{"type":"number"},"deductibleMinor":{"type":"number"},"categories":{"type":"array","items":{"$ref":"#/components/schemas/TaxCategory"}}},"required":["line","label","count","spentMinor","deductibleMinor","categories"]},"TaxMileage":{"type":"object","properties":{"unit":{"type":"string"},"trips":{"type":"number"},"distance":{"type":"number"},"deductionMinor":{"type":"number"}},"required":["unit","trips","distance","deductionMinor"]},"TaxPayee":{"type":"object","properties":{"merchantId":{"type":"string"},"name":{"type":"string"},"count":{"type":"number"},"totalMinor":{"type":"number"},"cardMinor":{"type":"number","description":"Paid by card. Card payments are reported by the processor, so a preparer usually sets these aside."},"taxIdOnFile":{"type":"boolean","description":"Whether a tax id is on file. The number itself is never shown or exported."}},"required":["merchantId","name","count","totalMinor","cardMinor","taxIdOnFile"]},"TrashedDocument":{"type":"object","properties":{"id":{"type":"string"},"type":{"$ref":"#/components/schemas/DocumentType"},"title":{"type":["string","null"]},"originalFilename":{"type":["string","null"]},"sizeBytes":{"type":"number"},"thumbnailUrl":{"type":["string","null"]},"deletedAt":{"type":"string"},"purgeOn":{"type":"string","description":"YYYY-MM-DD. The day this document and its files are deleted for good."}},"required":["id","type","title","originalFilename","sizeBytes","thumbnailUrl","deletedAt","purgeOn"]},"TrendPoint":{"type":"object","properties":{"totalMinor":{"type":"number","description":"Added up from the start of the period when the interval is `running`, like `count` and `sharePct`."},"count":{"type":"number"},"sharePct":{"type":"number","description":"Of the period's total, one decimal."},"previousLabel":{"description":"The point at the same position in the previous period.","type":["string","null"]},"previousMinor":{"type":"number"},"start":{"type":"string","description":"The days this point covers, cut to the period at either end."},"end":{"type":"string"},"label":{"type":"string"},"shortLabel":{"type":"string"}},"required":["totalMinor","count","sharePct","previousLabel","previousMinor","start","end","label","shortLabel"]},"TripRoute":{"type":"object","properties":{"origin":{"type":"string"},"stops":{"type":"array","items":{"type":"string"}},"destination":{"type":"string"},"distance":{"type":"number","description":"One way, as it would be typed."},"unit":{"type":"string"},"roundTrip":{"type":"boolean"},"lastDriven":{"type":"string"},"uses":{"type":"number"}},"required":["origin","stops","destination","distance","unit","roundTrip","lastDriven","uses"]},"WorkflowApprovalDocument":{"type":"object","properties":{"name":{"type":"string"},"merchant":{"type":["string","null"]},"total":{"type":["string","null"]},"url":{"type":["string","null"]}},"required":["name","merchant","total","url"]},"WorkflowApprovalState":{"type":"object","properties":{"recipients":{"type":"array","items":{"type":"string"}},"expiresAt":{"type":"string"},"decision":{"anyOf":[{"type":"string","enum":["approve","reject"]},{"type":"null"}]},"decidedBy":{"type":["string","null"]},"decidedAt":{"type":["string","null"]}},"required":["recipients","expiresAt","decision","decidedBy","decidedAt"]},"WorkflowFile":{"type":"object","properties":{"exportJobId":{"type":"string"},"filename":{"type":"string"},"rows":{"type":"number"},"url":{"description":"A signed link, or null once the file has expired.","type":["string","null"]}},"required":["exportJobId","filename","rows","url"]},"WorkflowIssue":{"type":"object","properties":{"code":{"type":"string","enum":["EMPTY","NO_START","NO_END","MISSING_CONFIG","CYCLE","INCOMPATIBLE","UNKNOWN_NODE","UNKNOWN_PORT","DUPLICATE_NODE","DUPLICATE_CONNECTION","BAD_DIRECTION","UNREACHABLE","DEAD_END","NO_SPLITTER","NOT_CONNECTED","NOT_SET_UP","NO_CLAUDE","NOT_ALLOWED"]},"message":{"type":"string"},"nodeId":{"type":"string"},"edgeId":{"type":"string"}},"required":["code","message"]},"WorkflowStep":{"type":"object","properties":{"id":{"type":"string"},"nodeId":{"type":"string"},"type":{"type":"string","enum":["api_import","document_aggregator","google_drive_import","gmail_input","dropbox_import","email_collector","ai_agent","convert_csv","convert_excel","decision","document_classifier","email_approval","extract_data","extract_data_set","pdf_splitter","split_collector","business_insights","email_file","google_drive","dropbox","google_sheets","xero_export"]},"label":{"type":"string"},"status":{"type":"string","enum":["PENDING","RUNNING","WAITING","DONE","SKIPPED","FAILED"]},"message":{"type":["string","null"]},"documents":{"type":"number"},"files":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowFile"}},"table":{"anyOf":[{"$ref":"#/components/schemas/WorkflowTablePreview"},{"type":"null"}]},"approval":{"anyOf":[{"$ref":"#/components/schemas/WorkflowApprovalState"},{"type":"null"}]},"startedAt":{"type":["string","null"]},"finishedAt":{"type":["string","null"]}},"required":["id","nodeId","type","label","status","message","documents","files","table","approval","startedAt","finishedAt"]},"WorkflowSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"version":{"description":"The version that runs. Null until it has been turned on once.","type":["number","null"]},"steps":{"type":"number"},"lastRunAt":{"type":["string","null"]},"lastRunStatus":{"anyOf":[{"type":"string","enum":["RUNNING","PAUSED","COMPLETED","FAILED","CANCELLED"]},{"type":"null"}]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","enabled","version","steps","lastRunAt","lastRunStatus","createdAt","updatedAt"]},"WorkflowTablePreview":{"type":"object","properties":{"title":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"array","items":{"type":["string","number","null"]}}},"totalRows":{"type":"number"}},"required":["title","columns","rows","totalRows"]},"WorkflowTrigger":{"type":"object","properties":{"nodeId":{"type":"string"},"type":{"type":"string","enum":["api_import","document_aggregator","google_drive_import","gmail_input","dropbox_import","email_collector","ai_agent","convert_csv","convert_excel","decision","document_classifier","email_approval","extract_data","extract_data_set","pdf_splitter","split_collector","business_insights","email_file","google_drive","dropbox","google_sheets","xero_export"]},"address":{"description":"Where to send documents, for an Email collector.","type":["string","null"]},"cadence":{"type":["string","null"]},"nextRunAt":{"type":["string","null"]},"lastRunAt":{"type":["string","null"]}},"required":["nodeId","type","address","cadence","nextRunAt","lastRunAt"]},"WorkspaceSummary":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["PERSONAL","TEAM"]},"baseCurrency":{"type":"string"},"role":{"$ref":"#/components/schemas/MemberRole"}},"required":["id","name","kind","baseCurrency","role"]},"AccountingShortcutKey":{"type":"string","enum":["awaiting-export","cash-accruals","card-accruals","card-statements","bank-reconciliation"]},"AccrualGrouping":{"type":"string","enum":["month","week","quarter","year"]},"AgentField":{"type":"string","enum":["report.totalMinor","report.expenseCount","report.categoryCount","report.daysSinceLastExpense","report.hasFindings","report.allReceipts","report.status","report.submitterId","expense.amountMinor","expense.ageDays","expense.isWeekend","expense.tipPct","expense.currency","expense.merchant","expense.description","expense.category","expense.hasTax","expense.hasTag","expense.tag","expense.hasReceipt","expense.itemized","expense.hasDescription","expense.paymentType","expense.flag","history.submitterSpend30dMinor","history.submitterSpendPrior30dMinor","history.submitterChangePct","history.submitterExpenseCount30d","history.submitterRank","history.workspaceSpend30dMinor","history.workspaceSpendPrior30dMinor","history.workspaceChangePct"]},"AgentOperator":{"type":"string","enum":["eq","ne","gt","gte","lt","lte","between","in","notIn","contains"]},"AgentRuleRole":{"type":"string","enum":["OBSERVER","APPROVER"]},"AgentStepTool":{"type":"string","enum":["post_to_thread","ask_submitter","approve_report","reject_report","reject_expenses","forward_report","take_over_report","submit_report","retract_report","unapprove_report","hold_expenses","release_expenses","update_expenses","mark_report_exported","export_to_accounting","post_in_room","post_to_admins","send_direct_message","split_expense_lines","fill_description","translate_receipt","tip_note"]},"ApiKeyScopeName":{"type":"string","enum":["documents:read","documents:write","documents:reveal","expenses:read","expenses:write","reports:read","reports:write","contacts:read","webhooks:manage","members:read","members:write","workspace:read","workspace:write","workspace:delete","rules:read","rules:write","cards:read","mailin:read","mailin:write","billing:read","billing:write","integrations:read"]},"ApprovalStepKind":{"type":"string","enum":["manager","user","role"]},"AsyncEnrichment":{"type":"string","enum":["duplicates","similar_documents","line_item_expansion","line_item_categorization","line_item_custom_categorization","xero_line_coding","address_parsing","fraud","rules","vendor_resolution"]},"AutoReportSchedule":{"type":"string","enum":["off","instant","daily","weekly","twice_monthly","monthly","by_trip"]},"BankAccountType":{"type":"string","enum":["CHECKING","SAVINGS"]},"BarcodeType":{"type":"string","enum":["QR_CODE","PDF417","EAN_13","EAN_8","UPC_A","UPC_E","CODE_128","CODE_39","ITF","DATA_MATRIX","AZTEC","OTHER"]},"BillingInterval":{"type":"string","enum":["MONTH","YEAR"]},"BudgetPeriod":{"type":"string","enum":["MONTH","YEAR"]},"BudgetScope":{"type":"string","enum":["CATEGORY","TAG","MEMBER"]},"CardLiability":{"type":"string","enum":["PERSONAL","CORPORATE"]},"CatalogReportKey":{"type":"string","enum":["fringe-benefit-tax","travel-spend","mileage","duty-of-care","hr","duplication","invoice-reconciliation"]},"CategoryOrigin":{"type":"string","enum":["SYSTEM","CUSTOM","ACCOUNTING"]},"CategoryType":{"type":"string","enum":["EXPENSE","COGS","INCOME","REFUND"]},"ChatPriorityMode":{"type":"string","enum":["MOST_RECENT","FOCUS"]},"CheckType":{"type":"string","enum":["bank_draft","bill_pay_draft","business_check","cashiers_check","government_check","money_order","personal_check","starter_check","teller_check"]},"CommuteExclusion":{"type":"string","enum":["NONE","ONE_WAY","BOTH_WAYS"]},"ContactExportFormat":{"type":"string","enum":["vcard","google","outlook","csv"]},"CopySection":{"type":"string","enum":["categories","tags","customFields","reportFields","distanceRates","perDiem","workflows","rules","merchantRules","policies","members","accountingConnection","overview"]},"CsvDelimiter":{"type":"string","enum":[",",";","\t","|"]},"DateFormat":{"type":"string","enum":["YYYY-MM-DD","MM/DD/YYYY","DD/MM/YYYY","DD.MM.YYYY","MMM D, YYYY"]},"DelegationAccess":{"type":"string","enum":["FULL","LIMITED"]},"DocumentColumnSet":{"type":"string","enum":["simple","detailed"]},"DocumentOrder":{"type":"string","enum":["created","updated","issued","total","tax","-created","-updated","-issued","-total","-tax"]},"DocumentSource":{"type":"string","enum":["WEB","IOS","ANDROID","EMAIL","API","MAIL_IN","INTEGRATION"]},"DocumentStatus":{"type":"string","enum":["UPLOADED","PROCESSING","PROCESSED","FAILED"]},"DocumentType":{"type":"string","enum":["RECEIPT","INVOICE","BILL","BANK_STATEMENT","CHECK","TAX_FORM","BUSINESS_CARD","OTHER","UNKNOWN","PURCHASE_ORDER","CONTRACT","PACKING_SLIP","REMITTANCE_ADVICE","CREDIT_NOTE","STATEMENT"]},"DomainJoinPolicy":{"type":"string","enum":["INVITE_ONLY","ASK","AUTO"]},"DuplicateField":{"type":"string","enum":["merchant","total","date","currency","invoiceNumber","cardLast4","postalCode"]},"ExpenseColumn":{"type":"string","enum":["receipt","merchant","date","category","status","amount","description","project","tags","owner","tax","reimbursable","billable","payment","type"]},"ExpenseDateField":{"type":"string","enum":["date","createdAt","updatedAt","submittedAt","approvedAt"]},"ExpenseGroupBy":{"type":"string","enum":["category","merchant","member","project","status","month"]},"ExpenseKind":{"type":"string","enum":["RECEIPT","MANUAL","MILEAGE","PER_DIEM","TIME","CARD"]},"ExpenseSort":{"type":"string","enum":["date:asc","date:desc","merchant:asc","merchant:desc","category:asc","category:desc","status:asc","status:desc","amount:asc","amount:desc"]},"ExpenseStatus":{"type":"string","enum":["PROCESSING","NEEDS_REVIEW","READY","SUBMITTED","APPROVED","REJECTED","REIMBURSED","VOID"]},"ExportFormat":{"type":"string","enum":["CSV","XLSX","PDF","ZIP","QBO_CSV","XERO_CSV","SAGE_CSV","DYNAMICS_CSV","MYOB_TXT","ORACLE_CSV","SAP_CSV","IIF","OFX","JSON","XML","TXT","XLS"]},"ExportKind":{"type":"string","enum":["expenses","report","tax","mileage","receipts","documents"]},"ExportPreset":{"type":"string","enum":["basic","all_data_expense","all_data_report","canadian_multiple_tax","category","per_diem","tag","tax_report"]},"FeedSource":{"type":"string","enum":["MANUAL","FILE_IMPORT","PLAID"]},"FraudColor":{"type":"string","enum":["GREEN","YELLOW","RED"]},"FraudMonitoredField":{"type":"string","enum":["totalMinor","subtotalMinor","taxMinor","tipMinor","date","merchantName","invoiceNumber","lineItems.amountMinor","lineItems.unitPriceMinor","check.amount","check.payee","check.date","check.micr","statement.balance","statement.transactions"]},"FraudReviewDecision":{"type":"string","enum":["FRAUD","NOT_FRAUD","UNKNOWN"]},"FraudReviewState":{"type":"string","enum":["PENDING","FRAUD","NOT_FRAUD","UNKNOWN"]},"FraudSignal":{"type":"string","enum":["digital_tampering","fraudulent_pdf","fraudulent_image","generated_document","ai_generated","lcd_photo","screenshot","digital_background","not_a_document","duplicate","similar_documents","handwritten_characters","invalid_qr_data","invalid_mrz_data","suspicious_content","data_inconsistency","vendor_layout_mismatch","total_in_words_mismatch","aspect_ratio_mismatch","high_velocity","critical_velocity","multiple_profiles_or_devices","fraud_history","blocked_device","other"]},"HrApprovalMode":{"type":"string","enum":["BASIC","MANAGER","CUSTOM"]},"IntegrationProvider":{"type":"string","enum":["QUICKBOOKS_ONLINE","XERO","FRESHBOOKS","WAVE","ZOHO_BOOKS","SAGE","NETSUITE","GUSTO","GOOGLE_DRIVE","DROPBOX","BOX","ONEDRIVE","GMAIL","SLACK","ZAPIER","QUICKBOOKS_DESKTOP","INTUIT_ENTERPRISE","CAMPFIRE","DUALENTRY","RILLET","ACCELO","CERTINIA","SAGE_BUSINESS_CLOUD","SAASU","BAMBOOHR","HIBOB","WORKDAY","GOOGLE_WORKSPACE","GREENHOUSE","EVERNOTE","QUICKBOOKS_TIME","RIGHTSIGNATURE","HR_SYNC","BILL_COM","SAP_CONCUR","MICROSOFT_DYNAMICS","MYOB","ORACLE","SAP_ERP"]},"IntegrityWarning":{"type":"string","enum":["tax_rate_mismatch","item_counts_mismatch","totals_mismatch","line_item_amount_mismatch","line_item_repeats","barcode_decoding_issue","barcode_code_missing_in_ocr","logo_vendor_mismatch","malware","weekend_transaction","time_and_currency_mismatch","exif_creation_modified_date_mismatch","missing_date","suspicious_document_aspect_ratio","generic_placeholder_content"]},"InvitationStatus":{"type":"string","enum":["PENDING","EXPIRED","ACCEPTED","REVOKED"]},"InvoiceStatus":{"type":"string","enum":["DRAFT","SENT","VIEWED","PARTIALLY_PAID","PAID","VOID"]},"InvoiceTaxKind":{"type":"string","enum":["VAT","SALES_TAX"]},"LineItemType":{"type":"string","enum":["room","tax","parking","service","fee","delivery","product","food","alcohol","tobacco","transportation","fuel","refund","discount","payment","giftcard","donation","toll","lottery"]},"MailInDisposal":{"type":"string","enum":["RETURN","SHRED"]},"MailInStatus":{"type":"string","enum":["REQUESTED","ENVELOPE_SENT","IN_TRANSIT","RECEIVED","SCANNING","COMPLETED","RETURNED","LOST","CANCELLED"]},"MappingEntity":{"type":"string","enum":["category","tag","project","client","payment_account","default"]},"MemberRole":{"type":"string","enum":["OWNER","ADMIN","APPROVER","ACCOUNTANT","AUDITOR","MEMBER","EDITOR","CARD_ADMIN","PEOPLE_ADMIN","PAYMENTS_ADMIN"]},"MemberStatus":{"type":"string","enum":["ACTIVE","SUSPENDED"]},"MerchantType":{"type":"string","enum":["airline","lodging","car_rental","ground_transport","fuel","dining","grocery","office","software","utilities","supplies","other"]},"MileagePurpose":{"type":"string","enum":["business","medical","charity"]},"OAuthScopeName":{"type":"string","enum":["documents:read","documents:write","documents:reveal","expenses:read","expenses:write","reports:read","reports:write","contacts:read","webhooks:manage","members:read","members:write","workspace:read","workspace:write","workspace:delete","rules:read","rules:write","cards:read","mailin:read","mailin:write","billing:read","billing:write","integrations:read","mcp:tools","mcp:write"]},"OnboardingIntent":{"type":"string","enum":["BUSINESS","PERSONAL","JOIN"]},"PaymentAccountKind":{"type":"string","enum":["CREDIT_CARD","DEBIT_CARD","BANK_ACCOUNT","CASH"]},"PaymentMethod":{"type":"string","enum":["none","visa","master_card","cash","american_express","interac","other","maestro","discover","bancontact","girocard","applepay","paypal","bancomat","giftcard","card","check","bankaxept","bank-to-bank_transfer_bacs","octopus","pix","jcb","waon","mada","wechat","alipay","unionpay","googlepay","rupay","bpay","shopeepay","mir","giropay","food_stamp","diners_club","paypay"]},"PaymentType":{"type":"string","enum":["CASH","PERSONAL_CARD","COMPANY_CARD","BANK_TRANSFER","CHECK","PAYPAL","OTHER"]},"PlanKey":{"type":"string","enum":["STARTER","PRO","BUSINESS"]},"PolicyRuleType":{"type":"string","enum":["MAX_AMOUNT","DAILY_LIMIT","RECEIPT_REQUIRED","MAX_AGE_DAYS","CATEGORY_REQUIRED","PROJECT_REQUIRED","DESCRIPTION_REQUIRED","ATTENDEES_REQUIRED","PROHIBITED","WEEKEND_SPEND","ITEMIZED_RECEIPT_REQUIRED","TAG_REQUIRED","FUTURE_DATE","COMPANY_CARD_REQUIRED","PROHIBITED_ITEM","ATTENDEE_LIMIT","RECEIPT_MISMATCH","BILLABLE_NOT_ALLOWED","CONVERSION_SURCHARGE","RATE_OUT_OF_POLICY","DISTANCE_INCREASED","NO_ROUTE","INACTIVE_VENDOR","OVER_AUTO_APPROVAL","TAG_OUT_OF_POLICY","TAX_OUT_OF_POLICY","TAX_REQUIRED","AI_GENERATED_RECEIPT","TRIP_LIMIT","FRINGE_BENEFITS"]},"PolicySeverity":{"type":"string","enum":["WARN","BLOCK_SUBMIT","WAIVE"]},"ProhibitedItem":{"type":"string","enum":["ADULT","ALCOHOL","GAMBLING","GIFT_CARD","HANDWRITTEN","HOTEL_INCIDENTALS","TOBACCO"]},"ReadingModel":{"type":"string","enum":["standard","rules_only","always_second_reading"]},"ReimbursementFailureCode":{"type":"string","enum":["NAME_MISMATCH","BUSINESS_ACCOUNT","ACCOUNT_NOT_FOUND","ACCOUNT_SWITCHED","UNABLE_TO_CONFIRM","OTHER"]},"ReimbursementMethod":{"type":"string","enum":["MANUAL","PAYROLL","ACH_FILE","ACH_PROVIDER"]},"ReimbursementStatus":{"type":"string","enum":["PENDING","PROCESSING","PAID","FAILED","CANCELLED"]},"ReleaseEnvironment":{"type":"string","enum":["production","sandbox"]},"ReleaseProduct":{"type":"string","enum":["app_web","api","mcp","model_document_extraction","model_bank_statements","model_checks","model_fraud_detection"]},"ReportCadence":{"type":"string","enum":["daily","weekly","monthly"]},"ReportFieldType":{"type":"string","enum":["TEXT","DATE","LIST","FORMULA"]},"ReportStatus":{"type":"string","enum":["DRAFT","SUBMITTED","APPROVED","REJECTED","REIMBURSED","EXPORTED","CLOSED"]},"RoomPosting":{"type":"string","enum":["ALL_MEMBERS","ADMINS_ONLY"]},"RoomVisibility":{"type":"string","enum":["PUBLIC","PRIVATE","WORKSPACE"]},"ScheduledReportKind":{"type":"string","enum":["expenses","mileage","tax"]},"SearchKind":{"type":"string","enum":["expense","document","report","merchant","contact","message","task"]},"SearchShortcutKey":{"type":"string","enum":["drafts","needs-approval","ready-to-pay"]},"SensitiveKind":{"type":"string","enum":["ROUTING_NUMBER","ACCOUNT_NUMBER","MICR_LINE","SSN","EIN","IBAN"]},"SlackReceipts":{"type":"string","enum":["OFF","ALL","TAGGED"]},"SsoProtocol":{"type":"string","enum":["SAML","OIDC"]},"SyncState":{"type":"string","enum":["PENDING","SYNCED","FAILED","SKIPPED","VOIDED"]},"TaxFormKind":{"type":"string","enum":["W2","W9","W8BEN_E"]},"TransactionState":{"type":"string","enum":["UNMATCHED","MATCHED","IGNORED","EXPENSED","PENDING"]},"TrendInterval":{"type":"string","enum":["day","week","month","quarter","year","running"]},"UiLanguage":{"type":"string","enum":["en","es","fr","de","el","it","ja","nl","pl","pt-BR","zh-Hans"]},"WebhookEvent":{"type":"string","enum":["document.created","document.processed","document.failed","document.enriched","document.enrichment_failed","document_set.completed","document_set.failed","split.completed","split.created","split.failed","split_and_classify.created","split_and_classify.failed","w2_set.created","w2_set.failed","bank_statement_set.created","bank_statement_set.failed","expense.created","expense.updated","expense.deleted","report.submitted","report.approved","report.rejected","report.reimbursed","integration.posted","integration.failed"]},"BlueprintField":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","const":"string"},"description":{"type":"string","maxLength":300},"format":{"type":"string","enum":["date","time"]},"enum":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"sensitive":{"$ref":"#/components/schemas/SensitiveKind"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","enum":["number","boolean"]},"description":{"type":"string","maxLength":300}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"integer"},"description":{"type":"string","maxLength":300},"format":{"type":"string","const":"minor"}},"required":["type"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"object"},"description":{"type":"string","maxLength":300},"properties":{"$ref":"#/components/schemas/SharedSchema0"}},"required":["type","properties"],"additionalProperties":false},{"type":"object","properties":{"type":{"type":"string","const":"array"},"description":{"type":"string","maxLength":300},"items":{"$ref":"#/components/schemas/BlueprintField"}},"required":["type","items"],"additionalProperties":false}]},"SpreadsheetUpload":{"$ref":"#/components/schemas/CreateAttachmentInput"},"SharedSchema0":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/BlueprintField"}}}}}