{"openapi":"3.1.0","info":{"title":"Buffalo Orbit API","version":"1.0.0","description":"Public integration contract. Read /docs/llms.txt for token aliases, agency isolation, MCP and retry rules."},"servers":[{"url":"https://dashboard.buffaloorbit.com","description":"Production"}],"externalDocs":{"url":"https://docs.buffaloorbit.com"},"components":{"schemas":{"Error":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"issues":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}},"required":["code","message"],"additionalProperties":{}}},"required":["error"],"additionalProperties":{}}},"securitySchemes":{"AccountSession":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Account session returned by login."},"SessionCookie":{"type":"apiKey","in":"cookie","name":"orbit_session"},"ApiKey":{"type":"http","scheme":"bearer","description":"API Key from dashboard. Store it under a secret alias; never paste a real key into code or documentation."},"DeviceCredential":{"type":"http","scheme":"bearer","description":"Approved device credential; not an API Key."},"TelegramWebhook":{"type":"apiKey","in":"header","name":"X-Telegram-Bot-Api-Secret-Token"}}},"paths":{"/auth/v1/api-keys":{"get":{"operationId":"get_auth_v1_api_keys","tags":["auth-service"],"summary":"List API keys","description":"List your API Keys; never returns secrets. Account session. API Keys are accepted only when x-api-key-supported is true. API Keys are not supported; use the declared account, device or webhook credential.","x-access":"session","x-api-key-supported":false,"x-permission-bit":0,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"limit (1-200, default 50)","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","required":false,"description":"offset (default 0)","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"hint":{"type":"string"},"permission_mask":{"type":"number"},"expires_at":{"type":"string"},"revoked_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","name","hint","permission_mask","expires_at","revoked_at","created_at"],"additionalProperties":{}}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"post_auth_v1_api_keys","tags":["auth-service"],"summary":"Create API key","description":"Create an expiring permission-limited API Key. Secret returned only once. Account session required. Account session. API Keys are accepted only when x-api-key-supported is true. API Keys are not supported; use the declared account, device or webhook credential.","x-access":"session","x-api-key-supported":false,"x-permission-bit":0,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"permission_mask":{"type":"integer","minimum":0,"maximum":9007199254740991},"expires_in_days":{"default":30,"type":"integer","minimum":1,"maximum":365}},"required":["name","permission_mask"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"hint":{"type":"string"},"permission_mask":{"type":"number"},"expires_at":{"type":"string"},"revoked_at":{"type":["string","null"]},"created_at":{"type":"string"},"key":{"type":"string"}},"required":["id","name","hint","permission_mask","expires_at","revoked_at","created_at","key"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/v1/api-keys/{id}":{"delete":{"operationId":"delete_auth_v1_api_keys_id","tags":["auth-service"],"summary":"Revoke API key","description":"Revoke your API Key immediately. Account session required. Account session. API Keys are accepted only when x-api-key-supported is true. API Keys are not supported; use the declared account, device or webhook credential.","x-access":"session","x-api-key-supported":false,"x-permission-bit":0,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"boolean","const":true}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations/v1/agent-config":{"get":{"operationId":"get_conversations_v1_agent_config","tags":["conversation-service"],"summary":"Get agent settings","description":"Read masked tenant Agent configuration; API keys are never returned. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_SETTINGS (32).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":32,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/conversations/v1/agent-config' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"provider":{"type":"string","enum":["cloudflare","buffalo"]},"protocol":{"type":"string","enum":["chat","responses"]},"model":{"type":"string"},"revision":{"type":"number"},"has_key":{"type":"boolean"},"has_jev_key":{"type":"boolean"}},"required":["provider","protocol","model","revision","has_key","has_jev_key"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"operationId":"put_conversations_v1_agent_config","tags":["conversation-service"],"summary":"Update agent settings","description":"Save tenant Cloudflare/Buffalo Agent selection, Vilao protocol/model and encrypted key; revision must match. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_SETTINGS (32).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":32,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"provider":{"type":"string","enum":["cloudflare","buffalo"]},"protocol":{"type":"string","enum":["chat","responses"]},"model":{"type":"string","minLength":1,"maxLength":200},"revision":{"type":"integer","minimum":0,"maximum":9007199254740991},"api_key":{"type":"string","maxLength":4096},"jev_key":{"type":"string","maxLength":4096},"remove_jev_key":{"type":"boolean"},"curl":{"type":"string","maxLength":16000}},"required":["provider","protocol","model","revision"]}}}},"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/conversations/v1/agent-config' --method PUT --headers '{\"Content-Type\":\"application/json\"}' --body - < request.json\n# request.json must match this operation’s request schema."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"provider":{"type":"string","enum":["cloudflare","buffalo"]},"protocol":{"type":"string","enum":["chat","responses"]},"model":{"type":"string"},"revision":{"type":"number"},"has_key":{"type":"boolean"},"has_jev_key":{"type":"boolean"}},"required":["provider","protocol","model","revision","has_key","has_jev_key"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"delete_conversations_v1_agent_config","tags":["conversation-service"],"summary":"Remove provider key","description":"Delete encrypted key and switch tenant to Cloudflare; revision must match. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_SETTINGS (32).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":32,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"revision":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["revision"]}}}},"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/conversations/v1/agent-config' --method DELETE --headers '{\"Content-Type\":\"application/json\"}' --body - < request.json\n# request.json must match this operation’s request schema."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"provider":{"type":"string","enum":["cloudflare","buffalo"]},"protocol":{"type":"string","enum":["chat","responses"]},"model":{"type":"string"},"revision":{"type":"number"},"has_key":{"type":"boolean"},"has_jev_key":{"type":"boolean"}},"required":["provider","protocol","model","revision","has_key","has_jev_key"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations/v1/agent-config/test":{"post":{"operationId":"post_conversations_v1_agent_config_test","tags":["conversation-service"],"summary":"Test agent settings","description":"Measure saved provider with a synthetic tool round trip; never writes tasks or changes provider selection. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_SETTINGS (32).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":32,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"case_id":{"type":"integer","minimum":1,"maximum":26},"provider":{"type":"string","enum":["cloudflare","buffalo"]},"reasoning_mode":{"default":"adaptive","type":"string","enum":["provider-default","none","low","high","adaptive"]},"scenario":{"default":"read","type":"string","enum":["read","chat","reason"]},"optimize_reads":{"default":true,"type":"boolean"}},"required":["provider"]}}}},"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/conversations/v1/agent-config/test' --method POST --headers '{\"Content-Type\":\"application/json\"}' --body - < request.json\n# request.json must match this operation’s request schema."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"anyOf":[{"type":"object","properties":{"provider":{"type":"string"},"model":{"type":"string"},"scenario":{"type":"string"},"reasoning_mode":{"type":"string"},"synthetic":{"type":"boolean"},"direct_read":{"type":"boolean"},"metrics":{"type":"array","items":{}},"answer":{"type":"string"},"passed":{"type":"boolean"},"router":{"type":"string"},"duration_ms":{"type":"number"},"tool_call_ok":{"type":"boolean"}},"required":["provider","model","scenario","reasoning_mode","synthetic","direct_read","metrics","answer","passed","router","duration_ms","tool_call_ok"],"additionalProperties":{}},{"type":"object","properties":{"provider":{"type":"string"},"id":{"type":"number"},"prompt":{"type":"string"},"expect":{"type":"string"},"calls":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"proposals":{"type":"array","items":{}},"metrics":{"type":"array","items":{}},"duration_ms":{"type":"number"},"synthetic":{"type":"boolean"},"category":{"type":"string"},"answer":{"type":"string"},"confirmation":{"type":"boolean"},"inference_calls":{"type":"number"},"direct_read":{"type":"boolean"},"error":{"type":"string"}},"required":["provider","id","prompt","expect","calls","proposals","metrics","duration_ms","synthetic"],"additionalProperties":{}}]}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/global/v1/managed-agencies":{"post":{"operationId":"post_global_v1_managed_agencies","tags":["directory-service"],"summary":"Create managed agency","description":"Root admin only: provision an agency D1, its first administrator and live task binding. Retry the same code after a provisioning failure. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: SUPER_ADMIN (256). Root agency (agency 1) administrator only.","x-access":"admin","x-api-key-supported":true,"x-permission-bit":256,"x-root-agency-only":true,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"type":"string","pattern":"^[a-z0-9][a-z0-9-]{1,40}$"},"name":{"type":"string","minLength":1,"maxLength":200},"admin_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,}$"},"admin_password":{"type":"string","minLength":12,"maxLength":72}},"required":["code","name","admin_email","admin_password"],"additionalProperties":false}}}},"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/global/v1/managed-agencies' --method POST --headers '{\"Content-Type\":\"application/json\"}' --body - < request.json\n# request.json must match this operation’s request schema."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"parent_code":{"type":["string","null"]},"level":{"type":"number"},"path":{"type":"string"},"db_name":{"type":"string"},"db_host":{"type":"string"},"is_active":{"type":"boolean"},"phone":{"type":"string"},"address":{"type":"string"},"status":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dynamic_key":{"type":["string","null"]},"db_state":{"type":["string","null"]},"already_provisioned":{"type":"boolean"}},"required":["id","code","name","parent_code","level","path","db_name","db_host","is_active","phone","address","status","created_at","updated_at","dynamic_key","db_state"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/global/v1/managed-agencies/{code}/delete":{"post":{"operationId":"post_global_v1_managed_agencies_code_delete","tags":["directory-service"],"summary":"Mark agency for deletion","description":"Root admin only: mark deleting and revoke agency sessions; database remains until confirmation. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: SUPER_ADMIN (256). Root agency (agency 1) administrator only.","x-access":"admin","x-api-key-supported":true,"x-permission-bit":256,"x-root-agency-only":true,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/global/v1/managed-agencies/{code}/delete' --method POST"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"code":{"type":"string"},"state":{"type":"string","const":"deleting"}},"required":["code","state"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/global/v1/managed-agencies/{code}/confirm-delete":{"post":{"operationId":"post_global_v1_managed_agencies_code_confirm_delete","tags":["directory-service"],"summary":"Delete agency permanently","description":"Root admin only: irreversibly delete a previously marked agency, its D1 and accounts; retire its namespace. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: SUPER_ADMIN (256). Root agency (agency 1) administrator only.","x-access":"admin","x-api-key-supported":true,"x-permission-bit":256,"x-root-agency-only":true,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"confirmation":{"type":"string","minLength":1,"maxLength":41}},"required":["confirmation"],"additionalProperties":false}}}},"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/global/v1/managed-agencies/{code}/confirm-delete' --method POST --headers '{\"Content-Type\":\"application/json\"}' --body - < request.json\n# request.json must match this operation’s request schema."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"code":{"type":"string"},"state":{"type":"string","const":"deleted"}},"required":["code","state"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/v1/login":{"post":{"operationId":"post_auth_v1_login","tags":["auth-service"],"summary":"Sign in","description":"Sign in; sets the orbit_session cookie and returns the token. No credentials. API Keys are not supported; use the declared account, device or webhook credential.","x-access":"public","x-api-key-supported":false,"x-permission-bit":0,"x-root-agency-only":false,"security":[],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","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,}$"},"password":{"type":"string","maxLength":1024}},"required":["email","password"]}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"access_token":{"type":"object","properties":{"token":{"type":"string"},"expires_at":{"type":"string"}},"required":["token","expires_at"],"additionalProperties":{}},"account":{"type":"object","properties":{"id":{"type":"string"},"tenant_id":{"type":"string"},"agency":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["admin","member"]},"active":{"type":"boolean"},"revision":{"type":"string","pattern":"^\\d+$"},"created_at":{"type":"string"}},"required":["id","tenant_id","agency","email","name","role","active","revision","created_at"],"additionalProperties":{}}},"required":["access_token","account"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/v1/logout":{"post":{"operationId":"post_auth_v1_logout","tags":["auth-service"],"summary":"Sign out","description":"End the current session. Account session. API Keys are accepted only when x-api-key-supported is true. API Keys are not supported; use the declared account, device or webhook credential.","x-access":"session","x-api-key-supported":false,"x-permission-bit":0,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]}],"parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"boolean","const":true}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/v1/profile":{"get":{"operationId":"get_auth_v1_profile","tags":["auth-service"],"summary":"Get profile","description":"Current account with its permission mask. Account session. API Keys are accepted only when x-api-key-supported is true. API Keys are supported. Required permission: authenticated account.","x-access":"session","x-api-key-supported":true,"x-permission-bit":0,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/auth/v1/profile' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"sub":{"type":"string"},"email":{"type":"string"},"tenant_id":{"type":"string"},"agency":{"type":"string"},"role":{"type":"string","enum":["admin","member"]},"name":{"type":"string"},"permission_mask":{"type":"number"}},"required":["sub","email","tenant_id","agency","role","name","permission_mask"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/v1/accounts":{"get":{"operationId":"get_auth_v1_accounts","tags":["auth-service"],"summary":"List accounts","description":"List accounts of the tenant. Account session with VIEW_USERS; API Keys additionally require administrator role. API Keys are supported. Required permission: VIEW_USERS (2).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":2,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"limit (1-200, default 50)","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","required":false,"description":"offset (default 0)","schema":{"type":"integer","minimum":0,"default":0}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/auth/v1/accounts' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"tenant_id":{"type":"string"},"agency":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["admin","member"]},"active":{"type":"boolean"},"revision":{"type":"string","pattern":"^\\d+$"},"created_at":{"type":"string"}},"required":["id","tenant_id","agency","email","name","role","active","revision","created_at"],"additionalProperties":{}}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"post_auth_v1_accounts","tags":["auth-service"],"summary":"Create account","description":"Create an account. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_USERS (1).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":1,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","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,}$"},"password":{"type":"string","minLength":12},"name":{"type":"string","minLength":1,"maxLength":200},"role":{"default":"member","type":"string","enum":["admin","member"]}},"required":["email","password","name"],"additionalProperties":false}}}},"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/auth/v1/accounts' --method POST --headers '{\"Content-Type\":\"application/json\"}' --body - < request.json\n# request.json must match this operation’s request schema."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"tenant_id":{"type":"string"},"agency":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["admin","member"]},"active":{"type":"boolean"},"revision":{"type":"string","pattern":"^\\d+$"},"created_at":{"type":"string"}},"required":["id","tenant_id","agency","email","name","role","active","revision","created_at"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/auth/v1/accounts/{id}":{"patch":{"operationId":"patch_auth_v1_accounts_id","tags":["auth-service"],"summary":"Update account","description":"Update name, role or active flag; revision must match. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_USERS (1).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":1,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"role":{"type":"string","enum":["admin","member"]},"active":{"type":"boolean"},"revision":{"type":"string","pattern":"^\\d+$"}},"required":["name","role","active","revision"],"additionalProperties":false}}}},"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/auth/v1/accounts/{id}' --method PATCH --headers '{\"Content-Type\":\"application/json\"}' --body - < request.json\n# request.json must match this operation’s request schema."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"tenant_id":{"type":"string"},"agency":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["admin","member"]},"active":{"type":"boolean"},"revision":{"type":"string","pattern":"^\\d+$"},"created_at":{"type":"string"}},"required":["id","tenant_id","agency","email","name","role","active","revision","created_at"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/user/v1/users":{"get":{"operationId":"get_user_v1_users","tags":["auth-service"],"summary":"List users","description":"List users in the legacy CMS shape, with paging.total. Account session with VIEW_USERS; API Keys additionally require administrator role. API Keys are supported. Required permission: VIEW_USERS (2).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":2,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"limit (1-200, default 50)","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","required":false,"description":"offset (default 0)","schema":{"type":"integer","minimum":0,"default":0}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/user/v1/users' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"avatar":{"type":"string"},"gender":{"type":"string"},"agency_user_id":{"type":"string"},"agency_code":{"type":"string"},"permission_mask":{"type":"number"},"agency_id":{"type":"number"},"status":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","first_name","last_name","email","phone","avatar","gender","agency_user_id","agency_code","permission_mask","agency_id","status","created_at","updated_at"],"additionalProperties":{}}},"code":{"type":"number","const":200},"paging":{"type":"object","properties":{"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"},"page":{"type":"number"}},"required":["total","limit","offset","page"],"additionalProperties":{}}},"required":["data","code","paging"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/user/v1/users/{id}/permission":{"patch":{"operationId":"patch_user_v1_users_id_permission","tags":["auth-service"],"summary":"Update user permissions","description":"Set a user permission bitmask. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_USERS (1).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":1,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"permission_mask":{"type":"integer","minimum":0,"maximum":9007199254740991},"agency_id":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["permission_mask"],"additionalProperties":false}}}},"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/user/v1/users/{id}/permission' --method PATCH --headers '{\"Content-Type\":\"application/json\"}' --body - < request.json\n# request.json must match this operation’s request schema."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"boolean","const":true}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/devices/v1/devices/enroll":{"post":{"operationId":"post_devices_v1_devices_enroll","tags":["device-service"],"summary":"Enroll device","description":"Register a device installation (pending until approved). Account session. API Keys are accepted only when x-api-key-supported is true. API Keys are not supported; use the declared account, device or webhook credential.","x-access":"session","x-api-key-supported":false,"x-permission-bit":0,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enrollment_key":{"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)$"},"platform":{"type":"string","enum":["macos","windows","linux"]},"manufacturer":{"type":"string","minLength":1,"maxLength":100},"serial":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","minLength":1,"maxLength":200},"reinstall":{"default":false,"type":"boolean"}},"required":["enrollment_key","platform","manufacturer","serial","label"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"tenant_id":{"type":"string"},"account_id":{"type":"string"},"enrollment_key":{"type":"string"},"platform":{"type":"string"},"manufacturer":{"type":"string"},"serial":{"type":"string"},"label":{"type":"string"},"status":{"type":"string","enum":["pending","approved","revoked"]},"dynamic_key":{"type":["string","null"]},"generation":{"type":"string","pattern":"^\\d+$"},"revision":{"type":"string","pattern":"^\\d+$"},"created_at":{"type":"string"}},"required":["id","tenant_id","account_id","enrollment_key","platform","manufacturer","serial","label","status","dynamic_key","generation","revision","created_at"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/devices/v1/devices/me":{"get":{"operationId":"get_devices_v1_devices_me","tags":["device-service"],"summary":"Get current device","description":"The calling device: its id and the dynamic key it must put in task keys before pushing. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are not supported; use the declared account, device or webhook credential.","x-access":"device","x-api-key-supported":false,"x-permission-bit":0,"x-root-agency-only":false,"security":[{"DeviceCredential":[]}],"parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"dynamic_key":{"type":"string"}},"required":["id","dynamic_key"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/devices/v1/devices":{"get":{"operationId":"get_devices_v1_devices","tags":["device-service"],"summary":"List devices","description":"List devices (admins see the whole tenant). Account session. API Keys are accepted only when x-api-key-supported is true. API Keys are not supported; use the declared account, device or webhook credential.","x-access":"session","x-api-key-supported":false,"x-permission-bit":0,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"limit (1-200, default 50)","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","required":false,"description":"offset (default 0)","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"tenant_id":{"type":"string"},"account_id":{"type":"string"},"enrollment_key":{"type":"string"},"platform":{"type":"string"},"manufacturer":{"type":"string"},"serial":{"type":"string"},"label":{"type":"string"},"status":{"type":"string","enum":["pending","approved","revoked"]},"dynamic_key":{"type":["string","null"]},"generation":{"type":"string","pattern":"^\\d+$"},"revision":{"type":"string","pattern":"^\\d+$"},"created_at":{"type":"string"}},"required":["id","tenant_id","account_id","enrollment_key","platform","manufacturer","serial","label","status","dynamic_key","generation","revision","created_at"],"additionalProperties":{}}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/devices/v1/devices/{id}/{action}":{"post":{"operationId":"post_devices_v1_devices_id_action","tags":["device-service"],"summary":"Manage device","description":"action is approve, revoke or rotate; approve and rotate return a one-time credential. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are not supported; use the declared account, device or webhook credential.","x-access":"admin","x-api-key-supported":false,"x-permission-bit":0,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"action","in":"path","required":true,"schema":{"type":"string","enum":["approve","revoke","rotate"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"revision":{"type":"string","pattern":"^\\d+$"}},"required":["revision"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"device":{"type":"object","properties":{"id":{"type":"string"},"tenant_id":{"type":"string"},"account_id":{"type":"string"},"enrollment_key":{"type":"string"},"platform":{"type":"string"},"manufacturer":{"type":"string"},"serial":{"type":"string"},"label":{"type":"string"},"status":{"type":"string","enum":["pending","approved","revoked"]},"dynamic_key":{"type":["string","null"]},"generation":{"type":"string","pattern":"^\\d+$"},"revision":{"type":"string","pattern":"^\\d+$"},"created_at":{"type":"string"}},"required":["id","tenant_id","account_id","enrollment_key","platform","manufacturer","serial","label","status","dynamic_key","generation","revision","created_at"],"additionalProperties":{}},"credential":{"type":["string","null"]}},"required":["device","credential"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tasks/v1/sync":{"post":{"operationId":"post_tasks_v1_sync","tags":["task-service"],"summary":"Sync tasks","description":"Commit a batch of tasks from a device. Replaying the same idempotency_key returns the first result. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are not supported; use the declared account, device or webhook credential.","x-access":"device","x-api-key-supported":false,"x-permission-bit":4,"x-root-agency-only":false,"security":[{"DeviceCredential":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"workspace":{"type":"string","minLength":1,"maxLength":200},"idempotency_key":{"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)$"},"after":{"type":"string","maxLength":20,"pattern":"^(0|[1-9]\\d*)$"},"sequence":{"type":"string","maxLength":20,"pattern":"^(0|[1-9]\\d*)$"},"snapshot":{"default":false,"type":"boolean"},"tasks":{"maxItems":40,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":4,"maxLength":25},"id":{"type":"string","pattern":"^[1-9]\\d{0,18}$"},"workspace":{"type":"string","minLength":1,"maxLength":200},"title":{"type":"string","minLength":1,"maxLength":1000},"status":{"type":"string","enum":["icebox","backlog","in_progress","in_review","blocked","done"]},"revision":{"type":"string","maxLength":20,"pattern":"^(0|[1-9]\\d*)$"},"priority":{"type":"string","maxLength":100},"labels":{"maxItems":100,"type":"array","items":{"type":"string","maxLength":100}},"parent":{"anyOf":[{"type":"string","maxLength":25},{"type":"null"}]},"lane":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"body":{"type":"string","maxLength":2000000},"claimed_by":{"type":["string","null"]},"worktree":{"type":["string","null"]},"criteria":{"maxItems":1000,"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"completed":{"type":"boolean"}},"required":["text","completed"]}},"plan":{"type":["string","null"]},"notes":{"maxItems":10000,"type":"array","items":{"type":"string"}},"spec":{"type":["string","null"]},"last_verified_result":{"type":["string","null"]},"report_score":{"type":["string","null"]},"aliases":{"type":"array","items":{"type":"string"}},"front_matter":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"deleted":{"default":false,"type":"boolean"}},"required":["key","workspace","title","status","revision","priority","labels","body","criteria","notes"],"additionalProperties":false}}},"required":["workspace","idempotency_key","after","sequence","tasks"],"additionalProperties":false}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"checkpoint":{"type":"string","pattern":"^\\d+$"},"accepted":{"type":"number"},"idempotency_key":{"type":"string"}},"required":["checkpoint","accepted","idempotency_key"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tasks/v1/sync/checkpoint":{"get":{"operationId":"get_tasks_v1_sync_checkpoint","tags":["task-service"],"summary":"Get sync checkpoint","description":"Last committed checkpoint of a workspace. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are not supported; use the declared account, device or webhook credential.","x-access":"device","x-api-key-supported":false,"x-permission-bit":8,"x-root-agency-only":false,"security":[{"DeviceCredential":[]}],"parameters":[{"name":"workspace","in":"query","required":true,"description":"workspace (required)","schema":{"type":"string"}}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"checkpoint":{"type":"string","pattern":"^\\d+$"}},"required":["checkpoint"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tasks/v1/tasks":{"get":{"operationId":"get_tasks_v1_tasks","tags":["task-service"],"summary":"List synced tasks","description":"List synced tasks. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are supported. Required permission: VIEW_TASKS (8).","x-access":"device","x-api-key-supported":true,"x-permission-bit":8,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]},{"DeviceCredential":[]}],"parameters":[{"name":"workspace","in":"query","required":false,"description":"workspace","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"status","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"limit (1-200, default 50)","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","required":false,"description":"offset (default 0)","schema":{"type":"integer","minimum":0,"default":0}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/tasks/v1/tasks' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"tenant_id":{"type":"string"},"account_id":{"type":"string"},"device_id":{"type":"string"},"workspace":{"type":"string"},"local_key":{"type":"string"},"display_key":{"type":"string"},"revision":{"type":"string","pattern":"^\\d+$"},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"deleted":{"type":"boolean"}},"required":["id","tenant_id","account_id","device_id","workspace","local_key","display_key","revision","payload","deleted"],"additionalProperties":{}}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tasks/v1/task-summaries":{"get":{"operationId":"get_tasks_v1_task_summaries","tags":["task-service"],"summary":"List task summaries","description":"Dashboard list: bounded summaries only, ordered by updated_at descending and id. Returns {items,has_more}; excludes deleted tasks. Open the source-specific detail endpoint for full content. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are supported. Required permission: VIEW_TASKS (8).","x-access":"device","x-api-key-supported":true,"x-permission-bit":8,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]},{"DeviceCredential":[]}],"parameters":[{"name":"source","in":"query","required":false,"description":"source (device, server or all; default all)","schema":{"type":"string","enum":["device","server","all"],"default":"all"}},{"name":"workspace","in":"query","required":false,"description":"workspace","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"status","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"limit (1-200, default 50)","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","required":false,"description":"offset (default 0)","schema":{"type":"integer","minimum":0,"default":0}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/tasks/v1/task-summaries' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"source":{"type":"string","enum":["device","server"]},"workspace":{"type":"string"},"revision":{"type":"string","pattern":"^\\d+$"},"updated_at":{"type":"string"},"title":{"type":"string"},"status":{"type":"string"},"priority":{"type":"string"},"labels":{"type":"array","items":{"type":"string"}},"body_preview":{"type":"string"},"claimed_by":{"type":["string","null"]},"spec":{"type":["string","null"]},"criteria_total":{"type":"number"},"criteria_completed":{"type":"number"},"created_via":{"type":["string","null"]}},"required":["id","key","source","workspace","revision","updated_at","title","status","priority","labels","body_preview","claimed_by","spec","criteria_total","criteria_completed","created_via"],"additionalProperties":{}}},"has_more":{"type":"boolean"}},"required":["items","has_more"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tasks/v1/workspaces/ensure":{"post":{"operationId":"post_tasks_v1_workspaces_ensure","tags":["task-service"],"summary":"Ensure workspace","description":"Register a workspace (git repository) in your agency, or return it if it exists. Returns workspace_id (derived from the key; a salt is added only on a rare collision) and max_counter, the highest task counter this device already pushed. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_TASKS (4).","x-access":"device","x-api-key-supported":true,"x-permission-bit":4,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]},{"DeviceCredential":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":200},"name":{"type":"string","maxLength":200},"remote_url":{"type":"string","maxLength":500}},"required":["key"],"additionalProperties":false}}}},"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/tasks/v1/workspaces/ensure' --method POST --headers '{\"Content-Type\":\"application/json\"}' --body - < request.json\n# request.json must match this operation’s request schema."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"workspace_id":{"type":"number"},"key":{"type":"string"},"salt":{"type":"number"},"name":{"type":"string"},"remote_url":{"type":"string"},"created_by":{"type":"string"},"created_at":{"type":"string"},"max_counter":{"type":"number"}},"required":["workspace_id","key","salt","name","remote_url","created_by","created_at","max_counter"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tasks/v1/workspaces":{"get":{"operationId":"get_tasks_v1_workspaces","tags":["task-service"],"summary":"List workspaces","description":"Workspaces registered in your agency. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are supported. Required permission: VIEW_TASKS (8).","x-access":"device","x-api-key-supported":true,"x-permission-bit":8,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]},{"DeviceCredential":[]}],"parameters":[],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/tasks/v1/workspaces' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"workspace_id":{"type":"number"},"key":{"type":"string"},"salt":{"type":"number"},"name":{"type":"string"},"remote_url":{"type":"string"},"created_by":{"type":"string"},"created_at":{"type":"string"}},"required":["workspace_id","key","salt","name","remote_url","created_by","created_at"],"additionalProperties":{}}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tasks/v1/nodes/me":{"get":{"operationId":"get_tasks_v1_nodes_me","tags":["task-service"],"summary":"Get task ID node","description":"The node (dynamic key) this device mints task ids with, the epoch of the 41-bit timestamp, and the newest timestamp this node already used, so a reinstalled machine never repeats an id. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are not supported; use the declared account, device or webhook credential.","x-access":"device","x-api-key-supported":false,"x-permission-bit":8,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"DeviceCredential":[]}],"parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"node":{"type":["number","null"]},"epoch":{"type":"number"},"last_timestamp":{"type":["number","null"]}},"required":["node","epoch","last_timestamp"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tasks/v1/server-tasks":{"post":{"operationId":"post_tasks_v1_server_tasks","tags":["task-service"],"summary":"Create server task","description":"Create a server task with the agency dynamic key and recorded creator. Members see only what they created; admins see the tenant. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_TASKS (4).","x-access":"device","x-api-key-supported":true,"x-permission-bit":4,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]},{"DeviceCredential":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":1000},"status":{"default":"backlog","type":"string","enum":["icebox","backlog","in_progress","in_review","blocked","done"]},"priority":{"default":"medium","type":"string","minLength":1,"maxLength":100},"body":{"default":"","type":"string","maxLength":200000},"labels":{"default":[],"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"workspace":{"default":"","type":"string","maxLength":200},"plan":{"default":null,"anyOf":[{"type":"string","maxLength":200000},{"type":"null"}]},"criteria":{"default":[],"maxItems":200,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":2000},"completed":{"type":"boolean"}},"required":["text","completed"]}},"notes":{"default":[],"maxItems":500,"type":"array","items":{"type":"string","maxLength":20000}}},"required":["title"],"additionalProperties":false}}}},"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/tasks/v1/server-tasks' --method POST --headers '{\"Content-Type\":\"application/json\"}' --body - < request.json\n# request.json must match this operation’s request schema."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"key":{"type":"string"},"local_key":{"type":"string"},"workspace":{"type":"string"},"revision":{"type":"string","pattern":"^\\d+$"},"seq":{"type":"string","pattern":"^\\d+$"},"deleted":{"type":"boolean"},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_by":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["key","local_key","workspace","revision","seq","deleted","payload","created_by","created_at","updated_at"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"get_tasks_v1_server_tasks","tags":["task-service"],"summary":"List server tasks","description":"List server tasks ordered by change sequence; pass after=<seq> to pull only newer changes. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are supported. Required permission: VIEW_TASKS (8).","x-access":"device","x-api-key-supported":true,"x-permission-bit":8,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]},{"DeviceCredential":[]}],"parameters":[{"name":"after","in":"query","required":false,"description":"after (sequence cursor)","schema":{"type":"string","pattern":"^\\d+$","default":"0"}},{"name":"workspace","in":"query","required":false,"description":"workspace","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"status","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"limit (1-200, default 50)","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/tasks/v1/server-tasks' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"local_key":{"type":"string"},"workspace":{"type":"string"},"revision":{"type":"string","pattern":"^\\d+$"},"seq":{"type":"string","pattern":"^\\d+$"},"deleted":{"type":"boolean"},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_by":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["key","local_key","workspace","revision","seq","deleted","payload","created_by","created_at","updated_at"],"additionalProperties":{}}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tasks/v1/server-tasks/{key}":{"get":{"operationId":"get_tasks_v1_server_tasks_key","tags":["task-service"],"summary":"Get server task","description":"One server task by display key (BF-...). Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are supported. Required permission: VIEW_TASKS (8).","x-access":"device","x-api-key-supported":true,"x-permission-bit":8,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]},{"DeviceCredential":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/tasks/v1/server-tasks/{key}' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"key":{"type":"string"},"local_key":{"type":"string"},"workspace":{"type":"string"},"revision":{"type":"string","pattern":"^\\d+$"},"seq":{"type":"string","pattern":"^\\d+$"},"deleted":{"type":"boolean"},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_by":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["key","local_key","workspace","revision","seq","deleted","payload","created_by","created_at","updated_at"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"patch_tasks_v1_server_tasks_key","tags":["task-service"],"summary":"Update server task","description":"Edit a server task. revision must equal the current one; the first writer wins and later ones get 409 REVISION_CONFLICT and must reload. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_TASKS (4).","x-access":"device","x-api-key-supported":true,"x-permission-bit":4,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]},{"DeviceCredential":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":1000},"status":{"type":"string","enum":["icebox","backlog","in_progress","in_review","blocked","done"]},"priority":{"type":"string","minLength":1,"maxLength":100},"body":{"type":"string","maxLength":200000},"labels":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"workspace":{"type":"string","maxLength":200},"plan":{"anyOf":[{"type":"string","maxLength":200000},{"type":"null"}]},"criteria":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"text":{"type":"string","maxLength":2000},"completed":{"type":"boolean"}},"required":["text","completed"]}},"notes":{"maxItems":500,"type":"array","items":{"type":"string","maxLength":20000}},"revision":{"type":"string","pattern":"^\\d+$"},"deleted":{"type":"boolean","const":true}},"required":["revision"],"additionalProperties":false}}}},"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/tasks/v1/server-tasks/{key}' --method PATCH --headers '{\"Content-Type\":\"application/json\"}' --body - < request.json\n# request.json must match this operation’s request schema."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"key":{"type":"string"},"local_key":{"type":"string"},"workspace":{"type":"string"},"revision":{"type":"string","pattern":"^\\d+$"},"seq":{"type":"string","pattern":"^\\d+$"},"deleted":{"type":"boolean"},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_by":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["key","local_key","workspace","revision","seq","deleted","payload","created_by","created_at","updated_at"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/tasks/v1/tasks/{id}":{"get":{"operationId":"get_tasks_v1_tasks_id","tags":["task-service"],"summary":"Get synced task","description":"One synced task. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are supported. Required permission: VIEW_TASKS (8).","x-access":"device","x-api-key-supported":true,"x-permission-bit":8,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]},{"DeviceCredential":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/tasks/v1/tasks/{id}' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"tenant_id":{"type":"string"},"account_id":{"type":"string"},"device_id":{"type":"string"},"workspace":{"type":"string"},"local_key":{"type":"string"},"display_key":{"type":"string"},"revision":{"type":"string","pattern":"^\\d+$"},"payload":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"deleted":{"type":"boolean"}},"required":["id","tenant_id","account_id","device_id","workspace","local_key","display_key","revision","payload","deleted"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/storage/v1/attachments":{"get":{"operationId":"get_storage_v1_attachments","tags":["storage-service"],"summary":"List attachments","description":"List attachments; optionally filter by a device task UUID or server task BF key. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are supported. Required permission: VIEW_TASKS (8).","x-access":"device","x-api-key-supported":true,"x-permission-bit":8,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]},{"DeviceCredential":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"limit (1-200, default 50)","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","required":false,"description":"offset (default 0)","schema":{"type":"integer","minimum":0,"default":0}},{"name":"task_id","in":"query","required":false,"description":"task_id (optional UUID or BF key)","schema":{"type":"string"}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/storage/v1/attachments' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"task_id":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"content_type":{"type":"string"},"checksum":{"type":"string"},"status":{"type":"string","enum":["pending","uploading","uploaded","ready","deleted"]},"created_at":{"type":"string"},"expires_at":{"type":"string"}},"required":["id","task_id","filename","size","content_type","checksum","status","created_at","expires_at"],"additionalProperties":{}}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"post_storage_v1_attachments","tags":["storage-service"],"summary":"Start attachment upload","description":"Start or resume an upload; X-Request-ID UUID makes retries idempotent. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_TASKS (4). Repeat X-Request-ID with the same body after an ambiguous response to reuse the attachment.","x-access":"device","x-api-key-supported":true,"x-permission-bit":4,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]},{"DeviceCredential":[]}],"parameters":[{"name":"X-Request-ID","in":"header","required":false,"description":"UUID; reuse with the same body to retry an ambiguous upload-intent response.","schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"task_id":{"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":"string","pattern":"^BF-[1-9A-HJ-NP-Za-km-z]{1,22}$"}]},"filename":{"type":"string","minLength":1,"maxLength":255,"pattern":"^[^\\/\\\\\\x00-\\x1f\\x7f]+$"},"size":{"type":"integer","minimum":1,"maximum":52428800},"content_type":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[a-zA-Z0-9!#$&^_.+-]+\\/[a-zA-Z0-9!#$&^_.+-]+$"},"checksum":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["task_id","filename","size","content_type","checksum"],"additionalProperties":false}}}},"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/storage/v1/attachments' --method POST --headers '{\"Content-Type\":\"application/json\"}' --body - < request.json\n# request.json must match this operation’s request schema."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"upload_url":{"type":"string"}},"required":["id","status","upload_url"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/storage/v1/attachments/{id}/content":{"put":{"operationId":"put_storage_v1_attachments_id_content","tags":["storage-service"],"summary":"Upload attachment","description":"Upload the bytes (Content-Length required, up to 50 MiB). Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are not supported; use the declared account, device or webhook credential. Body is the raw file.","x-access":"device","x-api-key-supported":false,"x-permission-bit":4,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"DeviceCredential":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Content-Length","in":"header","required":true,"description":"File size in bytes; 1 to 50 MiB.","schema":{"type":"integer","minimum":1,"maximum":52428800}}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","const":"uploaded"}},"required":["id","status"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/storage/v1/attachments/{id}/complete":{"post":{"operationId":"post_storage_v1_attachments_id_complete","tags":["storage-service"],"summary":"Complete attachment upload","description":"Verify size and checksum and mark the attachment ready. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_TASKS (4).","x-access":"device","x-api-key-supported":true,"x-permission-bit":4,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]},{"DeviceCredential":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/storage/v1/attachments/{id}/complete' --method POST"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"task_id":{"type":"string"},"filename":{"type":"string"},"size":{"type":"number"},"content_type":{"type":"string"},"checksum":{"type":"string"},"status":{"type":"string","enum":["pending","uploading","uploaded","ready","deleted"]},"created_at":{"type":"string"},"expires_at":{"type":"string"}},"required":["id","task_id","filename","size","content_type","checksum","status","created_at","expires_at"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/storage/v1/attachments/{id}/download":{"get":{"operationId":"get_storage_v1_attachments_id_download","tags":["storage-service"],"summary":"Download attachment","description":"Download the file bytes. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are not supported; use the declared account, device or webhook credential.","x-access":"device","x-api-key-supported":false,"x-permission-bit":8,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"DeviceCredential":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"File bytes.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/storage/v1/attachments/{id}":{"delete":{"operationId":"delete_storage_v1_attachments_id","tags":["storage-service"],"summary":"Delete attachment","description":"Delete an attachment. Account session or approved device credential; some sync operations require a device. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_TASKS (4).","x-access":"device","x-api-key-supported":true,"x-permission-bit":4,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]},{"DeviceCredential":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/storage/v1/attachments/{id}' --method DELETE"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","const":"deleted"}},"required":["id","status"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/global/v1/agencies":{"get":{"operationId":"get_global_v1_agencies","tags":["directory-service"],"summary":"List agencies","description":"List agencies (flat; build the tree from parent_code). Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_ROLES (16).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":16,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"limit (1-200, default 50)","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","required":false,"description":"offset (default 0)","schema":{"type":"integer","minimum":0,"default":0}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/global/v1/agencies' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"parent_code":{"type":["string","null"]},"level":{"type":"number"},"path":{"type":"string"},"db_name":{"type":"string"},"db_host":{"type":"string"},"is_active":{"type":"boolean"},"phone":{"type":"string"},"address":{"type":"string"},"status":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dynamic_key":{"type":["string","null"]},"db_state":{"type":["string","null"]},"already_provisioned":{"type":"boolean"}},"required":["id","code","name","parent_code","level","path","db_name","db_host","is_active","phone","address","status","created_at","updated_at","dynamic_key","db_state"],"additionalProperties":{}}},"code":{"type":"number","const":200},"paging":{"type":"object","properties":{"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"},"page":{"type":"number"}},"required":["total","limit","offset","page"],"additionalProperties":{}}},"required":["data","code","paging"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"post_global_v1_agencies","tags":["directory-service"],"summary":"Create agency","description":"Root agency admin with MANAGE_ROLES only: create an agency; parent_code makes it a sub-agency. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_ROLES (16). Root agency (agency 1) administrator only.","x-access":"admin","x-api-key-supported":true,"x-permission-bit":16,"x-root-agency-only":true,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{1,99}$"},"name":{"type":"string","minLength":1,"maxLength":255},"parent_code":{"anyOf":[{"type":"string","pattern":"^[a-z0-9][a-z0-9_-]{1,99}$"},{"type":"null"}]},"phone":{"default":"","type":"string","maxLength":20},"address":{"default":"","type":"string","maxLength":500}},"required":["code","name"],"additionalProperties":false}}}},"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/global/v1/agencies' --method POST --headers '{\"Content-Type\":\"application/json\"}' --body - < request.json\n# request.json must match this operation’s request schema."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"parent_code":{"type":["string","null"]},"level":{"type":"number"},"path":{"type":"string"},"db_name":{"type":"string"},"db_host":{"type":"string"},"is_active":{"type":"boolean"},"phone":{"type":"string"},"address":{"type":"string"},"status":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dynamic_key":{"type":["string","null"]},"db_state":{"type":["string","null"]},"already_provisioned":{"type":"boolean"}},"required":["id","code","name","parent_code","level","path","db_name","db_host","is_active","phone","address","status","created_at","updated_at","dynamic_key","db_state"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/global/v1/agencies/{code}":{"get":{"operationId":"get_global_v1_agencies_code","tags":["directory-service"],"summary":"Get agency","description":"One agency by code. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_ROLES (16).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":16,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/global/v1/agencies/{code}' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"number"},"code":{"type":"string"},"name":{"type":"string"},"parent_code":{"type":["string","null"]},"level":{"type":"number"},"path":{"type":"string"},"db_name":{"type":"string"},"db_host":{"type":"string"},"is_active":{"type":"boolean"},"phone":{"type":"string"},"address":{"type":"string"},"status":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dynamic_key":{"type":["string","null"]},"db_state":{"type":["string","null"]},"already_provisioned":{"type":"boolean"}},"required":["id","code","name","parent_code","level","path","db_name","db_host","is_active","phone","address","status","created_at","updated_at","dynamic_key","db_state"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"delete_global_v1_agencies_code","tags":["directory-service"],"summary":"Delete agency","description":"Soft-delete an agency that has no sub-agencies. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_ROLES (16).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":16,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/global/v1/agencies/{code}' --method DELETE"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"boolean","const":true}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/global/v1/agencies/{code}/provision-database":{"post":{"operationId":"post_global_v1_agencies_code_provision_database","tags":["directory-service"],"summary":"Provision agency database","description":"Not supported on this platform; always 501. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are not supported; use the declared account, device or webhook credential.","x-access":"admin","x-api-key-supported":false,"x-permission-bit":16,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]}],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"501":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/global/v1/roles":{"get":{"operationId":"get_global_v1_roles","tags":["directory-service"],"summary":"List roles","description":"List permission roles (each owns one bit). Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_ROLES (16).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":16,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/global/v1/roles' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"display_name":{"type":"string"},"bit_value":{"type":"number"},"description":{"type":"string"}},"required":["id","name","display_name","bit_value","description"],"additionalProperties":{}}},"code":{"type":"number","const":200},"paging":{"type":"object","properties":{"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"},"page":{"type":"number"}},"required":["total","limit","offset","page"],"additionalProperties":{}}},"required":["data","code","paging"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"post_global_v1_roles","tags":["directory-service"],"summary":"Create role","description":"Create a role; the next free bit is assigned. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_ROLES (16).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":16,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"},"display_name":{"type":"string","minLength":1,"maxLength":100},"description":{"default":"","type":"string","maxLength":500}},"required":["name"],"additionalProperties":false}}}},"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/global/v1/roles' --method POST --headers '{\"Content-Type\":\"application/json\"}' --body - < request.json\n# request.json must match this operation’s request schema."}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"display_name":{"type":"string"},"bit_value":{"type":"number"},"description":{"type":"string"}},"required":["id","name","display_name","bit_value","description"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations/v1/telegram/webhook":{"post":{"operationId":"post_conversations_v1_telegram_webhook","tags":["conversation-service"],"summary":"Receive Telegram webhook","description":"Telegram bot webhook. Authenticated by the X-Telegram-Bot-Api-Secret-Token header; not for clients. Telegram only: X-Telegram-Bot-Api-Secret-Token header. API Keys are not supported; use the declared account, device or webhook credential. Body is a Telegram Update.","x-access":"webhook","x-api-key-supported":false,"x-permission-bit":32,"x-root-agency-only":false,"security":[{"TelegramWebhook":[]}],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Telegram Update; unsupported updates are acknowledged with status ignored.","additionalProperties":true}}}},"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations/v1/link-codes":{"post":{"operationId":"post_conversations_v1_link_codes","tags":["conversation-service"],"summary":"Create Telegram link code","description":"Create a one-time code (valid 10 minutes). Send `/link <code>` to the Telegram bot to let it read and edit tasks as this account. Account session. API Keys are accepted only when x-api-key-supported is true. API Keys are not supported; use the declared account, device or webhook credential.","x-access":"session","x-api-key-supported":false,"x-permission-bit":32,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]}],"parameters":[],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"code":{"type":"string"},"expires_at":{"type":"string"}},"required":["code","expires_at"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations/v1/conversations":{"get":{"operationId":"get_conversations_v1_conversations","tags":["conversation-service"],"summary":"List conversations","description":"List chat sessions, newest activity first. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: VIEW_REPORTS (64).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":64,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"limit (1-200, default 50)","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","required":false,"description":"offset (default 0)","schema":{"type":"integer","minimum":0,"default":0}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/conversations/v1/conversations' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string"},"external_chat_id":{"type":"string"},"title":{"type":"string"},"username":{"type":"string"},"message_count":{"type":"number"},"last_message":{"type":"string"},"last_message_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","channel","external_chat_id","title","username","message_count","last_message","last_message_at","created_at"],"additionalProperties":{}}},"code":{"type":"number","const":200},"paging":{"type":"object","properties":{"total":{"type":"number"},"limit":{"type":"number"},"offset":{"type":"number"},"page":{"type":"number"}},"required":["total","limit","offset","page"],"additionalProperties":{}}},"required":["data","code","paging"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations/v1/conversations/{id}":{"get":{"operationId":"get_conversations_v1_conversations_id","tags":["conversation-service"],"summary":"Get conversation","description":"One conversation. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: VIEW_REPORTS (64).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":64,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/conversations/v1/conversations/{id}' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"channel":{"type":"string"},"external_chat_id":{"type":"string"},"title":{"type":"string"},"username":{"type":"string"},"message_count":{"type":"number"},"last_message":{"type":"string"},"last_message_at":{"type":["string","null"]},"created_at":{"type":"string"}},"required":["id","channel","external_chat_id","title","username","message_count","last_message","last_message_at","created_at"],"additionalProperties":{}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"delete_conversations_v1_conversations_id","tags":["conversation-service"],"summary":"Delete conversation","description":"Delete a conversation and its messages. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: MANAGE_SETTINGS (32).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":32,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/conversations/v1/conversations/{id}' --method DELETE"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"boolean","const":true}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/conversations/v1/conversations/{id}/messages":{"get":{"operationId":"get_conversations_v1_conversations_id_messages","tags":["conversation-service"],"summary":"List messages","description":"Messages of a conversation, oldest first. Administrator and the required permission bit. API Keys also need x-api-key-supported. API Keys are supported. Required permission: VIEW_REPORTS (64).","x-access":"admin","x-api-key-supported":true,"x-permission-bit":64,"x-root-agency-only":false,"security":[{"AccountSession":[]},{"SessionCookie":[]},{"ApiKey":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"limit (1-200, default 50)","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},{"name":"offset","in":"query","required":false,"description":"offset (default 0)","schema":{"type":"integer","minimum":0,"default":0}}],"x-codeSamples":[{"lang":"Shell","label":"Buffalo token alias","source":"buffalo api_request --alias buffalo-orbit-api --url 'https://dashboard.buffaloorbit.com/conversations/v1/conversations/{id}/messages' --method GET"}],"responses":{"200":{"description":"Success.","content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"},"content":{"type":"string"},"created_at":{"type":"string"}},"required":["id","role","content","created_at"],"additionalProperties":{}}}},"required":["data"],"additionalProperties":{}}}}},"4XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"5XX":{"description":"Error code and message; validation errors may include issues.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}