{"openapi":"3.1.1","info":{"title":"Colby Partner API","version":"1.0.0","description":"Manage credited companies, recorder setup, quality coaching, earnings and event delivery."},"servers":[{"url":"https://colby.ing"}],"externalDocs":{"description":"Developer guide and endpoint reference","url":"https://colby.ing/partners/docs/api"},"tags":[{"name":"Access"},{"name":"Companies"},{"name":"Equipment"},{"name":"Recording and QA"},{"name":"Feedback"},{"name":"Payments"},{"name":"Events and retries"}],"security":[{"PartnerOAuth":["partner.lifecycle"]}],"components":{"securitySchemes":{"PartnerOAuth":{"type":"oauth2","description":"Authorization code with S256 PKCE and resource=https://colby.ing/api/partner/v1. Sign in as the partner who will use the integration.","flows":{"authorizationCode":{"authorizationUrl":"https://colby.ing/oauth/authorize","tokenUrl":"https://colby.ing/oauth/token","refreshUrl":"https://colby.ing/oauth/token","scopes":{"partner.lifecycle":"Operate the signed partner's authorized company lifecycle."}}}}}},"paths":{"/api/partner/v1":{"get":{"tags":["Access"],"operationId":"getPartnerApiDirectory","summary":"Read the public API directory","description":"Discovery links, authentication instructions and the partner workflow. No account data is returned.","security":[],"responses":{"200":{"description":"API directory","content":{"application/json":{"schema":{"type":"object","properties":{"resource":{"type":"string","format":"uri"},"scope":{"type":"string"},"documentation":{"type":"string","format":"uri"},"openapi":{"type":"string","format":"uri"},"quickstart":{"type":"string","format":"uri"},"workflow":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"required":["resource","scope","documentation","openapi","quickstart","workflow"]}}}}}}},"/.well-known/oauth-protected-resource/api/partner/v1":{"get":{"operationId":"getPartnerResourceMetadata","summary":"Discover the partner resource","description":"Read the resource identifier, issuer, documentation URL and supported scope.","tags":["Access"],"security":[],"responses":{"200":{"description":"Resource metadata","content":{"application/json":{"schema":{"type":"object","properties":{"resource":{"type":"string","format":"uri"},"authorization_servers":{"type":"array","items":{"type":"string","format":"uri"}},"scopes_supported":{"type":"array","items":{"type":"string"}},"bearer_methods_supported":{"type":"array","items":{"type":"string"}},"resource_name":{"type":"string"},"resource_documentation":{"type":"string","format":"uri"}},"required":["resource","authorization_servers","scopes_supported","bearer_methods_supported","resource_name","resource_documentation"]}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"operationId":"discoverAuthorizationServer","summary":"Discover the OAuth server","description":"Read the supported grants, token endpoint authentication methods and PKCE method.","tags":["Access"],"security":[],"responses":{"200":{"description":"Issuer metadata","content":{"application/json":{"schema":{"type":"object","properties":{"issuer":{"type":"string","format":"uri"},"authorization_endpoint":{"type":"string","format":"uri"},"token_endpoint":{"type":"string","format":"uri"},"registration_endpoint":{"type":"string","format":"uri"},"revocation_endpoint":{"type":"string","format":"uri"},"scopes_supported":{"type":"array","items":{"type":"string"}},"grant_types_supported":{"type":"array","items":{"type":"string"}},"code_challenge_methods_supported":{"type":"array","items":{"type":"string"}},"response_types_supported":{"type":"array","items":{"type":"string"}},"response_modes_supported":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_methods_supported":{"type":"array","items":{"type":"string"}},"revocation_endpoint_auth_methods_supported":{"type":"array","items":{"type":"string"}},"authorization_response_iss_parameter_supported":{"type":"boolean"},"service_documentation":{"type":"string","format":"uri"}},"required":["issuer","authorization_endpoint","token_endpoint","registration_endpoint","revocation_endpoint","scopes_supported","grant_types_supported","code_challenge_methods_supported","response_types_supported","response_modes_supported","token_endpoint_auth_methods_supported","revocation_endpoint_auth_methods_supported","authorization_response_iss_parameter_supported","service_documentation"]}}}}}}},"/oauth/register":{"post":{"operationId":"registerPartnerClient","summary":"Register your OAuth client","description":"Send the exact approved hosted callback URL, or a loopback callback for local development. The issuer accepts one to ten supported callback URLs. A confidential client receives its secret at registration.","tags":["Access"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"redirect_uris":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":10},"client_name":{"type":"string","maxLength":80},"token_endpoint_auth_method":{"type":"string","enum":["none","client_secret_post","client_secret_basic"]},"grant_types":{"type":"array","items":{"type":"string","enum":["authorization_code","refresh_token"]}}},"required":["redirect_uris"]},"example":{"redirect_uris":["http://127.0.0.1:8040/callback"],"client_name":"Field Operations","token_endpoint_auth_method":"none","grant_types":["authorization_code","refresh_token"]}}}},"responses":{"201":{"description":"Registered client","content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"client_secret":{"type":"string"},"client_secret_expires_at":{"type":"integer"},"client_id_issued_at":{"type":"integer"},"client_name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string","format":"uri"}},"grant_types":{"type":"array","items":{"type":"string"}},"response_types":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_method":{"type":"string","enum":["none","client_secret_post","client_secret_basic"]}},"required":["client_id","client_id_issued_at","redirect_uris","grant_types","response_types","token_endpoint_auth_method"]}}}},"400":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}},"required":["error"]}}}},"429":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}},"required":["error"]}}}}}}},"/oauth/authorize":{"get":{"operationId":"authorizePartnerClient","summary":"Authorize in the browser","description":"Direct the user to this URL with an S256 PKCE challenge. Bind state and the verifier to this login session. On callback, verify state and the issuer before exchanging the code.","tags":["Access"],"security":[],"parameters":[{"name":"client_id","in":"query","required":true,"schema":{"type":"string"}},{"name":"redirect_uri","in":"query","required":true,"schema":{"type":"string","format":"uri"}},{"name":"response_type","in":"query","required":true,"schema":{"const":"code","type":"string"}},{"name":"scope","in":"query","required":true,"schema":{"type":"string","const":"partner.lifecycle"}},{"name":"resource","in":"query","required":true,"schema":{"type":"string","const":"https://colby.ing/api/partner/v1"}},{"name":"state","in":"query","required":false,"schema":{"type":"string"}},{"name":"code_challenge_method","in":"query","required":true,"schema":{"type":"string","const":"S256"}},{"name":"code_challenge","in":"query","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{43,128}$"}}],"responses":{"200":{"description":"Sign-in or consent page","content":{"text/html":{"schema":{"type":"string"}}}},"303":{"description":"Browser redirect to the registered callback with the result","headers":{"Location":{"schema":{"type":"string","format":"uri"}}}},"400":{"description":"Invalid authorization request"}}}},"/oauth/token":{"post":{"operationId":"exchangePartnerToken","summary":"Exchange a code or rotate a refresh token","description":"Exchange the code once with its original verifier. Persist the rotated access and refresh tokens together. Confidential clients authenticate as registered.","tags":["Access"],"security":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"oneOf":[{"type":"object","properties":{"client_id":{"type":"string"},"client_secret":{"type":"string","description":"For a confidential client using client_secret_post. A client using client_secret_basic supplies its registered credentials in the Authorization header."},"grant_type":{"const":"authorization_code"},"code":{"type":"string"},"code_verifier":{"type":"string"},"redirect_uri":{"type":"string","format":"uri"},"resource":{"type":"string","const":"https://colby.ing/api/partner/v1"}},"required":["grant_type","code","code_verifier"]},{"type":"object","properties":{"client_id":{"type":"string"},"client_secret":{"type":"string","description":"For a confidential client using client_secret_post. A client using client_secret_basic supplies its registered credentials in the Authorization header."},"grant_type":{"const":"refresh_token"},"refresh_token":{"type":"string"},"resource":{"type":"string","const":"https://colby.ing/api/partner/v1"},"scope":{"type":"string","const":"partner.lifecycle"}},"required":["grant_type","refresh_token"]}]}}}},"responses":{"200":{"description":"Issued tokens","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string","const":"Bearer"},"expires_in":{"type":"integer"},"refresh_token":{"type":"string"},"scope":{"type":"string","const":"partner.lifecycle"}},"required":["access_token","token_type","expires_in","refresh_token","scope"]}}}},"400":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}},"required":["error"]}}}},"401":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}},"required":["error"]}}}},"429":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}},"required":["error"]}}}}}}},"/oauth/revoke":{"post":{"operationId":"revokePartnerToken","summary":"Disconnect a grant","description":"Supply an access or refresh token issued to this client. A successful revocation removes access for the connection.","tags":["Access"],"security":[],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"client_id":{"type":"string"},"client_secret":{"type":"string","description":"For a confidential client using client_secret_post. A client using client_secret_basic supplies its registered credentials in the Authorization header."},"token":{"type":"string"}},"required":["token"]}}}},"responses":{"200":{"description":"Revocation processed","content":{"application/json":{"schema":{"type":"object","properties":{},"required":[]}}}},"401":{"description":"OAuth error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/me":{"get":{"operationId":"getPartnerIdentity","summary":"Read your partner workspace","description":"Returns the acting account, role and effective permissions. Check permissions.request_agreements before offering to request a company agreement. Resource access also depends on the company's current signed credit and lifecycle state.","tags":["Access"],"responses":{"200":{"description":"Current workspace","content":{"application/json":{"schema":{"type":"object","properties":{"partner_id":{"type":"string"},"business":{"type":["string","null"]},"name":{"type":"string"},"role":{"type":"string","enum":["owner","member"]},"features":{"type":"object","additionalProperties":{"type":"boolean"}},"payee_reference":{"type":["string","null"]},"permissions":{"type":"object","properties":{"request_agreements":{"type":"boolean","description":"True only for an owner whose workspace enables company agreement requests."},"request_closure":{"type":"boolean"},"read_settlement":{"type":"boolean"},"manage_webhooks":{"type":"boolean"}},"required":["request_agreements","request_closure","read_settlement","manage_webhooks"]}},"required":["partner_id","business","name","role","features","payee_reference","permissions"]},"example":{"partner_id":"partner_example","business":"Example Field Services","name":"Example owner","role":"owner","features":{},"payee_reference":"partner_example","permissions":{"request_agreements":true,"request_closure":true,"read_settlement":true,"manage_webhooks":true}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}},"parameters":[]}},"/api/partner/v1/requests/{request_id}":{"get":{"operationId":"getRequestReceipt","summary":"Look up a write receipt","description":"Use X-Request-Id from a write on this OAuth connection. Inspect http_status for the original result. A reconciliation state calls for reading the resource before taking further action.","tags":["Events and retries"],"parameters":[{"in":"path","name":"request_id","required":true,"schema":{"type":"string"},"description":"ID returned by Colby for this connection."}],"responses":{"200":{"description":"Completed request","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]},"example":{"request_id":"req_example","state":"complete","http_status":201,"result":{"id":"example-company"}}}}},"202":{"description":"Processing or awaiting reconciliation","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]},"example":{"request_id":"req_example","state":"processing","http_status":null,"result":null}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/events":{"get":{"operationId":"listPartnerEvents","summary":"Read lifecycle events","description":"Read in increasing sequence order. Persist next_cursor after processing. Company access is checked at read time. Finance events require an owner.","tags":["Events and retries"],"parameters":[{"in":"query","name":"cursor","schema":{"type":"integer","minimum":0,"default":0},"description":"Last processed sequence number."},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}}],"responses":{"200":{"description":"Scoped event page","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer","minimum":0},"event_type":{"type":"string"},"resource_id":{"type":"string"},"org_id":{"type":["string","null"]},"state":{"type":["string","null"]},"observed_at":{"type":"string","format":"date-time"}},"required":["seq","event_type","resource_id","org_id","state","observed_at"]}},"next_cursor":{"type":"integer","minimum":0},"has_more":{"type":"boolean"}},"required":["events","next_cursor","has_more"]},"example":{"events":[{"seq":72,"event_type":"qa.result","resource_id":"rec_example","org_id":"org_example","state":"checked","observed_at":"2031-04-16T09:15:00Z"}],"next_cursor":72,"has_more":false}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/webhook-subscriptions":{"get":{"operationId":"listWebhookSubscriptions","summary":"List webhook subscriptions","description":"Owners can inspect subscriptions created through the same connection. Failures and the acknowledged cursor show delivery progress.","tags":["Events and retries"],"responses":{"200":{"description":"Subscription delivery state","content":{"application/json":{"schema":{"type":"object","properties":{"subscriptions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"},"cursor":{"type":"integer","minimum":0},"state":{"type":"string","enum":["active","paused"]},"failures":{"type":"integer","minimum":0},"next_attempt":{"type":"string","format":"date-time"}},"required":["id","url","cursor","state","failures","next_attempt"]}}},"required":["subscriptions"]},"example":{"subscriptions":[]}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}},"parameters":[]},"post":{"operationId":"subscribeToPartnerEvents","summary":"Subscribe or resume a webhook","description":"Owners can register an HTTPS URL on the exact hosted callback hostname that authorized the grant. Use the default HTTPS port and a URL without user information, query parameters or a fragment. Re-registering the same URL on the same grant with a fresh request key resumes its saved cursor. Save the signing secret from the first-dispatch response. A local loopback grant can poll the feed.","tags":["Events and retries"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","format":"uri","maxLength":2048}},"required":["url"]},"example":{"url":"https://integration.example.com/colby/events"}}}},"responses":{"200":{"description":"Operation receipt on retry. Inspect http_status and fetch the current resource.","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"201":{"description":"Created or resumed subscription","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"cursor":{"type":"integer","minimum":0},"signing_secret":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"Store privately. This UTF-8 text is the HMAC key."}},"required":["id","cursor","signing_secret"]}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Operation receipt on retry. Inspect http_status and fetch the current resource.","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}},"parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"},"description":"One key per intended change within this OAuth connection. Reuse only with the original method, path, query and JSON body."}]}},"/api/partner/v1/webhook-subscriptions/{subscription_id}":{"delete":{"operationId":"deleteWebhookSubscription","summary":"Remove a webhook","description":"The owner of the same OAuth connection can remove this subscription. A delivery already in progress may still arrive.","tags":["Events and retries"],"parameters":[{"in":"path","name":"subscription_id","required":true,"schema":{"type":"string"},"description":"ID returned by Colby for this connection."},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"},"description":"One key per intended change within this OAuth connection. Reuse only with the original method, path, query and JSON body."}],"responses":{"200":{"description":"Removed subscription A replay may return the saved request receipt.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"example":{"id":"hook_example"}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Operation receipt on retry. Inspect http_status and fetch the current resource.","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies":{"get":{"tags":["Companies"],"operationId":"listPartnerCompanies","summary":"List or look up companies","description":"Use external_id for an exact registration lookup. Without status, q searches the partner pipeline in pages of up to 50 companies. prospect returns pipeline companies without verified operating credit. operating returns the full signed, credited portfolio, including companies with a paused enrollment or closure. paused, closing and closed narrow that portfolio to the corresponding enrollment or exit state. Combine a status filter with q, limit and after. external_id takes precedence over all list filters. Continue each list using its own next_cursor.","parameters":[{"name":"external_id","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Exact company ID from your system. Returns zero or one registration."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["prospect","operating","paused","closing","closed"]},"description":"Choose the pipeline, credited portfolio or an enrollment or exit state."},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100},"description":"Search company records in the selected list."},{"name":"after","in":"query","required":false,"schema":{"type":"string","maxLength":180},"description":"Pass the previous page’s next_cursor unchanged. Omit for the first page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Maximum number of results in this page."}],"responses":{"200":{"description":"Pipeline page, operating portfolio page, or exact registration lookup.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"partner_company_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"name":{"type":"string"},"operating_company_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"external_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"trade":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","partner_company_id","name","operating_company_id","external_id"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor"],"additionalProperties":false},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"partner_company_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"name":{"type":"string"},"operating_company_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"external_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"trade":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","partner_company_id","name","operating_company_id","external_id"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"after":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor","after"],"additionalProperties":false},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"operating_company_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"name":{"type":"string"}},"required":["id","operating_company_id","name"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"after":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor","after"],"additionalProperties":false},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"partner_company_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"operating_company_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"external_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"name":{"type":"string","maxLength":200},"trade":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","partner_company_id","operating_company_id","external_id","name","trade","region","created_at"],"additionalProperties":false},"maxItems":1},"next_cursor":{"type":"null"}},"required":["items","next_cursor"],"additionalProperties":false}]},"examples":{"pipeline":{"value":{"items":[{"id":"company_demo_01","partner_company_id":"company_demo_01","operating_company_id":null,"external_id":null,"name":"Example Field Services"}],"next_cursor":null}},"prospect":{"value":{"items":[{"id":"company_demo_01","partner_company_id":"company_demo_01","operating_company_id":null,"external_id":"service-company-001","name":"Example Field Services","trade":"Building services","region":"Southwest"}],"next_cursor":null,"after":null}},"operating":{"value":{"items":[{"id":"org_demo_01","operating_company_id":"org_demo_01","name":"Example Field Services"}],"next_cursor":null,"after":null}},"paused":{"value":{"items":[{"id":"org_demo_01","operating_company_id":"org_demo_01","name":"Example Field Services"}],"next_cursor":null,"after":null}},"closing":{"value":{"items":[{"id":"org_demo_01","operating_company_id":"org_demo_01","name":"Example Field Services"}],"next_cursor":null,"after":null}},"closed":{"value":{"items":[{"id":"org_demo_01","operating_company_id":"org_demo_01","name":"Example Field Services"}],"next_cursor":null,"after":null}},"externalId":{"value":{"items":[{"id":"company_demo_01","partner_company_id":"company_demo_01","operating_company_id":null,"external_id":"service-company-001","name":"Example Field Services","trade":"Building services","region":"Southwest","created_at":"2027-03-02T16:30:00Z"}],"next_cursor":null}}}}}},"202":{"description":"Registration of the specified external_id is in progress. Repeat the GET to poll.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","maxItems":0},"status":{"type":"string","enum":["registering"]},"next_cursor":{"type":"null"}},"required":["items","status","next_cursor"],"additionalProperties":false},"examples":{"registering":{"value":{"items":[],"status":"registering","next_cursor":null}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Companies"],"operationId":"registerPartnerCompany","summary":"Register a company","description":"Supply a stable external ID unique within your partner account, a legal name, a state, and a site contact with an email or phone. Save the returned partner_company_id for onboarding. An operating_company_id appears once a completed agreement and current credit are verified. Registering a company does not send an agreement.","parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"},"description":"One key per intended change within this OAuth connection. Reuse only with the original method, path, query and JSON body."}],"requestBody":{"required":true,"description":"Partner registration and contact details.","content":{"application/json":{"schema":{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"legal_name":{"type":"string","maxLength":200,"minLength":1},"name":{"type":"string","maxLength":200,"description":"Alias for legal_name."},"state":{"type":"string","maxLength":2,"pattern":"^[A-Za-z]{2}$","description":"Two-letter US state abbreviation."},"site_lead":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"minLength":1},"email":{"type":"string","format":"email","maxLength":254},"phone":{"type":"string","maxLength":40}},"required":["name"],"additionalProperties":false,"anyOf":[{"required":["email"]},{"required":["phone"]}]},"person":{"type":"object","properties":{"name":{"type":"string","maxLength":200,"minLength":1},"email":{"type":"string","format":"email","maxLength":254},"phone":{"type":"string","maxLength":40}},"required":["name"],"additionalProperties":false,"anyOf":[{"required":["email"]},{"required":["phone"]}],"description":"Alias for site_lead."},"signer":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"email":{"type":"string","format":"email","maxLength":254},"title":{"type":"string","maxLength":120}},"required":[],"additionalProperties":false},"street":{"type":"string","maxLength":160},"city":{"type":"string","maxLength":120},"postal_code":{"type":"string","maxLength":10},"phone":{"type":"string","maxLength":40},"website":{"type":"string","maxLength":300},"trade":{"type":"string","maxLength":100},"region":{"type":"string","maxLength":100}},"required":["external_id","state"],"additionalProperties":false,"allOf":[{"anyOf":[{"required":["legal_name"]},{"required":["name"]}]},{"anyOf":[{"required":["site_lead"]},{"required":["person"]}]}]},"examples":{"company":{"value":{"external_id":"service-company-001","legal_name":"Example Field Services","state":"AZ","trade":"Building services","region":"Southwest","site_lead":{"name":"Example Site Lead","email":"site-lead@example.invalid"},"signer":{"name":"Example Signer","email":"signer@example.invalid","title":"Owner"}}}}}}},"responses":{"200":{"description":"The matching company was previously registered under this external ID. A replay may return the saved request receipt.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"partner_company_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"operating_company_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"external_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"name":{"type":"string","maxLength":200},"trade":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","partner_company_id","operating_company_id","external_id","name","trade","region","created_at"],"additionalProperties":false},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"examples":{"existing":{"value":{"id":"company_demo_01","partner_company_id":"company_demo_01","operating_company_id":null,"external_id":"service-company-001","name":"Example Field Services","trade":"Building services","region":"Southwest","created_at":"2027-03-02T16:30:00Z"}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"201":{"description":"Company registered.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"partner_company_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"operating_company_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"external_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"name":{"type":"string","maxLength":200},"trade":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","partner_company_id","operating_company_id","external_id","name","trade","region","created_at"],"additionalProperties":false},"examples":{"registered":{"value":{"id":"company_demo_01","partner_company_id":"company_demo_01","operating_company_id":null,"external_id":"service-company-001","name":"Example Field Services","trade":"Building services","region":"Southwest","created_at":"2027-03-02T16:30:00Z"}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Operation receipt on retry. Inspect http_status and fetch the current resource.","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"The external ID conflicts or the registration is being reconciled. Query by external_id to check its status.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false},"examples":{"refused":{"value":{"error":"This external ID belongs to a different registered company."}}}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}":{"get":{"tags":["Companies"],"operationId":"getPartnerCompany","summary":"Read a company","description":"Use a partner company ID or a credited operating company ID. Existing pipeline companies may have no external ID. The response includes registration metadata when it exists.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."}],"responses":{"200":{"description":"Company visible to this account.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"partner_company_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"operating_company_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"external_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"name":{"type":"string","maxLength":200},"trade":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"}},"required":["id","partner_company_id","operating_company_id","external_id","name","trade","region","created_at"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"partner_company_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"name":{"type":"string"},"operating_company_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"external_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]}},"required":["id","partner_company_id","name","operating_company_id","external_id"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"name":{"type":"string"},"operating_company_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"external_id":{"type":"null"}},"required":["id","name","operating_company_id","external_id"],"additionalProperties":false}]},"examples":{"registration":{"value":{"id":"company_demo_01","partner_company_id":"company_demo_01","operating_company_id":null,"external_id":"service-company-001","name":"Example Field Services","trade":"Building services","region":"Southwest","created_at":"2027-03-02T16:30:00Z"}},"operating":{"value":{"id":"org_demo_01","operating_company_id":"org_demo_01","name":"Example Field Services","external_id":null}},"pipeline":{"value":{"id":"company_demo_01","partner_company_id":"company_demo_01","operating_company_id":null,"external_id":null,"name":"Example Field Services"}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/agreements":{"get":{"tags":["Companies"],"operationId":"listCompanyAgreements","summary":"Read agreement history","description":"Returns the latest 50 agreement requests, newest first. client_signed_at records the company signature and completed_at records completion.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."}],"responses":{"200":{"description":"Agreement history.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"status":{"type":"string","enum":["review","sending","sent","signed","declined","voided"]},"created_at":{"type":"string","format":"date-time"},"client_signed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","status","created_at","client_signed_at","completed_at"],"additionalProperties":false},"maxItems":50}},"required":["items"],"additionalProperties":false},"examples":{"latest":{"value":{"items":[{"id":"agreement_demo_01","status":"sent","created_at":"2027-03-02T16:30:00Z","client_signed_at":null,"completed_at":null}]}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Companies"],"operationId":"requestCompanyAgreement","summary":"Request a company agreement","description":"Call this endpoint only when GET /me returns permissions.request_agreements as true. It requires an owner whose workspace enables company agreement requests. The company must be registered and have an available deal with a site contact. Supply the address and kit count. A signer name and email must be present in this request or saved at registration. If a referral match needs attention, the response identifies attribution_review. Poll the agreement history for signing progress.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"},"description":"One key per intended change within this OAuth connection. Reuse only with the original method, path, query and JSON body."}],"requestBody":{"required":true,"description":"Company agreement request.","content":{"application/json":{"schema":{"type":"object","properties":{"kits":{"type":"integer","minimum":1,"maximum":50},"address":{"type":"string","maxLength":300,"minLength":1},"signer":{"type":"object","properties":{"name":{"type":"string","maxLength":200},"email":{"type":"string","format":"email","maxLength":254},"title":{"type":"string","maxLength":120}},"required":[],"additionalProperties":false},"signer_name":{"type":"string","maxLength":200,"description":"Overrides signer.name and the name saved during registration."},"signer_email":{"type":"string","format":"email","maxLength":254,"description":"Overrides signer.email and the address saved during registration."},"signer_title":{"type":"string","maxLength":120},"hours_month":{"anyOf":[{"type":"integer","minimum":1,"maximum":100000},{"type":"null"}]},"notes":{"type":"string","maxLength":2000},"rate":{"anyOf":[{"type":"number","exclusiveMinimum":0,"description":"Optional company-specific request, subject to the account's agreement."},{"type":"null"}]},"phones":{"type":"string","enum":["colby","own"],"default":"colby","description":"Request kit phones or straps for supported company-owned phones."}},"required":["kits","address"],"additionalProperties":false},"examples":{"request":{"value":{"kits":3,"address":"100 Example Way, Example City, AZ 85001","phones":"colby","signer":{"name":"Example Signer","email":"signer@example.invalid","title":"Owner"}}}}}}},"responses":{"200":{"description":"Operation receipt on retry. Inspect http_status and fetch the current resource.","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Agreement request accepted or attribution review required. A replay may return the saved request receipt.","content":{"application/json":{"schema":{"anyOf":[{"oneOf":[{"type":"object","properties":{"id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"status":{"type":"string"},"route":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","status","route"],"additionalProperties":false},{"type":"object","properties":{"status":{"type":"string","enum":["attribution_review"]},"required_action":{"type":"string"}},"required":["status","required_action"],"additionalProperties":false}]},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"examples":{"requested":{"value":{"id":"agreement_demo_01","status":"sent","route":null}},"review":{"value":{"status":"attribution_review","required_action":"Resolve the referral match before sending an agreement."}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The caller is a team member or agreement requests are disabled for this workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false},"examples":{"teamMember":{"value":{"error":"owner_only"}},"workspaceDisabled":{"value":{"error":"contracts_disabled"}}}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/onboarding":{"get":{"tags":["Companies"],"operationId":"getCompanyOnboarding","summary":"Read onboarding progress","description":"Poll after registration, signature, enrollment or closure. Use required_action, responsible_party and action_path for the next step. At awaiting_credit, the agreement is signed and Colby is verifying the company's partner credit. Continue polling onboarding. crew_materials contains setup and quality instructions. For a directly credited open company, progress identifies kit handoffs, first uploads and acceptances, open feedback and dated follow-ups. first_acceptance_at is the earliest source decision time among present uploads currently accepted. progress is null during closure and when direct credit is unavailable.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."}],"responses":{"200":{"description":"Onboarding stage and next action.","content":{"application/json":{"schema":{"type":"object","properties":{"company_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"operating_company_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"stage":{"type":"string","enum":["registered","agreement_requested","agreement_ended","awaiting_credit","provisioning","needs_action","ready","closing","closed"]},"agreement":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"status":{"type":"string","enum":["review","sending","sent","signed","declined","voided"]},"created_at":{"type":"string","format":"date-time"},"client_signed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","status","created_at","client_signed_at","completed_at"],"additionalProperties":false},{"type":"null"}]},"enrollment":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["awaiting_agreement","queued","issuing","verifying","reconciling","needs_action","ready","retiring","retired"]},"detail":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","detail"],"additionalProperties":false},{"type":"null"}]},"required_action":{"anyOf":[{"type":"string"},{"type":"null"}]},"responsible_party":{"anyOf":[{"type":"string","enum":["partner_owner","company_signer","colby","site_lead","partner_team"]},{"type":"null"}]},"action_path":{"anyOf":[{"type":"string"},{"type":"null"}]},"crew_materials":{"type":"object","properties":{"kit_setup":{"type":"string","format":"uri"},"crew_en":{"type":"string","format":"uri"},"crew_es":{"type":"string","format":"uri"},"accepted_tasks":{"type":"string","format":"uri"},"quality_criteria":{"type":"string","format":"uri"}},"required":["kit_setup","crew_en","crew_es","accepted_tasks","quality_criteria"],"additionalProperties":false},"progress":{"anyOf":[{"type":"object","properties":{"code_delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"first_dispatched_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"first_delivered_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"first_upload_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"first_acceptance_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"assigned_kits":{"type":"integer","minimum":0},"setup_kits":{"type":"integer","minimum":0},"kit_first_uploads":{"type":"integer","minimum":0},"kit_first_acceptances":{"type":"integer","minimum":0},"open_feedback":{"type":"integer","minimum":0},"follow_ups":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"owner":{"type":"string","enum":["site_lead","partner_team"]},"due_at":{"type":"string","format":"date-time"},"resource":{"type":"string"}},"required":["key","owner","due_at","resource"],"additionalProperties":false}}},"required":["code_delivered_at","first_dispatched_on","first_delivered_on","first_upload_at","first_acceptance_at","assigned_kits","setup_kits","kit_first_uploads","kit_first_acceptances","open_feedback","follow_ups"],"additionalProperties":false},{"type":"null"}]}},"required":["company_id","operating_company_id","stage","agreement","enrollment","required_action","responsible_party","action_path","crew_materials","progress"],"additionalProperties":false},"examples":{"signing":{"value":{"company_id":"company_demo_01","operating_company_id":null,"stage":"agreement_requested","agreement":{"id":"agreement_demo_01","status":"sent","created_at":"2027-03-02T16:30:00Z","client_signed_at":null,"completed_at":null},"enrollment":null,"required_action":"Complete the agreement.","responsible_party":"company_signer","action_path":"/api/partner/v1/companies/company_demo_01/agreements","crew_materials":{"kit_setup":"https://colby.ing/setup/kit","crew_en":"https://colby.ing/setup/crew","crew_es":"https://colby.ing/setup/crew/es","accepted_tasks":"https://colby.ing/accepted-tasks","quality_criteria":"https://colby.ing/partners/docs/what-gets-accepted"},"progress":null}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/minute-enrollment":{"get":{"tags":["Companies"],"operationId":"getCompanyMinuteEnrollment","summary":"Read the company’s Minute enrollment","description":"Read the company-specific provisioning state. code is populated only while the company has a verified active, exclusively assigned code. Use detail when reconciliation or another action is needed. Keep codes private to the intended company and crew.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."}],"responses":{"200":{"description":"Current enrollment.","content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"string","enum":["awaiting_agreement","queued","issuing","verifying","reconciling","needs_action","ready","retiring","retired"]},"detail":{"anyOf":[{"type":"string"},{"type":"null"}]},"enrollment_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"code":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","detail","enrollment_id","code"],"additionalProperties":false},"examples":{"pending":{"value":{"state":"queued","detail":null,"enrollment_id":null,"code":null}},"active":{"value":{"state":"ready","detail":null,"enrollment_id":"enrollment_demo_01","code":"EXAMPLE-ONLY"}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}},"put":{"tags":["Companies"],"operationId":"ensureCompanyMinuteEnrollment","summary":"Ensure a Minute enrollment exists","description":"Signed, credited registrations are queued automatically. Use this call to ensure provisioning for an eligible company. Send an empty request body. Poll GET on this path until ready. A reconciling state requires resolving the provider result before another issuance.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"},"description":"One key per intended change within this OAuth connection. Reuse only with the original method, path, query and JSON body."}],"responses":{"200":{"description":"An active dedicated code is already verified. A replay may return the saved request receipt.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["awaiting_agreement","queued","issuing","verifying","reconciling","needs_action","ready","retiring","retired"]},"detail":{"anyOf":[{"type":"string"},{"type":"null"}]},"enrollment_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"code":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","detail","enrollment_id","code"],"additionalProperties":false},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"examples":{"active":{"value":{"state":"ready","detail":null,"enrollment_id":"enrollment_demo_01","code":"EXAMPLE-ONLY"}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Enrollment processing or reconciliation is pending. A replay may return the saved request receipt.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["awaiting_agreement","queued","issuing","verifying","reconciling","needs_action","ready","retiring","retired"]},"detail":{"anyOf":[{"type":"string"},{"type":"null"}]},"enrollment_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"code":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","detail","enrollment_id","code"],"additionalProperties":false},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"examples":{"queued":{"value":{"state":"queued","detail":null,"enrollment_id":null,"code":null}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"The company is ineligible or closing.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["awaiting_agreement","queued","issuing","verifying","reconciling","needs_action","ready","retiring","retired"]},"detail":{"anyOf":[{"type":"string"},{"type":"null"}]},"enrollment_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"code":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["state","detail","enrollment_id","code"],"additionalProperties":false},{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false}]},"examples":{"awaiting":{"value":{"state":"awaiting_agreement","detail":"A completed agreement and current partner credit are required.","enrollment_id":null,"code":null}},"closing":{"value":{"error":"The company is closing."}}}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/code-deliveries":{"get":{"tags":["Companies"],"operationId":"listCompanyCodeDeliveries","summary":"List code delivery attempts","description":"Read automatic and requested company-code emails and their send status.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"name":"after","in":"query","required":false,"schema":{"type":"string","maxLength":180},"description":"Pass the previous page’s next_cursor unchanged. Omit for the first page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Maximum number of results in this page."}],"responses":{"200":{"description":"A page in ascending ID order. A null next_cursor ends the list.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"status":{"type":"string","enum":["sending","sent","failed","no_email"]},"created_at":{"type":"string","format":"date-time"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","status","created_at","sent_at"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"after":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor","after"],"additionalProperties":false},"examples":{"page":{"value":{"items":[{"id":"delivery_demo_01","status":"sent","created_at":"2027-03-02T16:30:00Z","sent_at":"2027-03-02T16:30:00Z"}],"next_cursor":null,"after":null}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Companies"],"operationId":"sendCompanyMinuteCode","summary":"Resend the company code","description":"Sends the verified enrollment code to the company contact already on file. The system sends the initial code automatically. Send an empty request body. An in-progress or very recent delivery prevents a duplicate send. Read GET /code-deliveries to check the result.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"},"description":"One key per intended change within this OAuth connection. Reuse only with the original method, path, query and JSON body."}],"responses":{"200":{"description":"Operation receipt on retry. Inspect http_status and fetch the current resource.","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"201":{"description":"Email accepted by the sender.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"status":{"type":"string","enum":["sent"]},"email":{"type":"string","format":"email","maxLength":254}},"required":["id","status","email"],"additionalProperties":false},"examples":{"sent":{"value":{"id":"delivery_demo_01","status":"sent","email":"site-lead@example.invalid"}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"The attempted send failed. Inspect the delivery record before another request. A replay may return the saved request receipt.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"status":{"type":"string","enum":["failed"]},"email":{"type":"string","format":"email","maxLength":254}},"required":["id","status","email"],"additionalProperties":false},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"examples":{"failed":{"value":{"id":"delivery_demo_01","status":"failed","email":"site-lead@example.invalid"}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"An active code, an eligible recipient or a completed prior send is required.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false},"examples":{"refused":{"value":{"error":"Code delivery is in progress."}}}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/recorder-invitations":{"get":{"tags":["Companies"],"operationId":"listCompanyRecorderInvitations","summary":"List recorder invitations","description":"Read crew email invitations, their language, and their delivery state. A sent invitation and a joined recorder are separate records.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"name":"after","in":"query","required":false,"schema":{"type":"string","maxLength":180},"description":"Pass the previous page’s next_cursor unchanged. Omit for the first page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Maximum number of results in this page."}],"responses":{"200":{"description":"A page in ascending ID order. A null next_cursor ends the list.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"email":{"type":"string","format":"email","maxLength":254},"language":{"type":"string","enum":["en","es"]},"status":{"type":"string","enum":["sending","sent","failed","delivery_unknown"]},"created_at":{"type":"string","format":"date-time"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","email","language","status","created_at","sent_at"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"after":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor","after"],"additionalProperties":false},"examples":{"page":{"value":{"items":[{"id":"invite_demo_01","email":"recorder@example.invalid","language":"en","status":"sent","created_at":"2027-03-02T16:30:00Z","sent_at":"2027-03-02T16:30:00Z"}],"next_cursor":null,"after":null}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"410":{"description":"The company has closed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false},"examples":{"refused":{"value":{"error":"The company has closed."}}}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Companies"],"operationId":"inviteCompanyRecorder","summary":"Invite a recorder","description":"Emails the intended crew member the company code and setup guide in the requested language. Requires a ready, open enrollment. An existing invitation for the company and address is returned without sending another email. Use GET /recorders to verify a subsequent linked account.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"},"description":"One key per intended change within this OAuth connection. Reuse only with the original method, path, query and JSON body."}],"requestBody":{"required":true,"description":"Intended recorder and preferred language.","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","maxLength":254},"language":{"type":"string","enum":["en","es"],"default":"en"}},"required":["email"],"additionalProperties":false},"examples":{"invite":{"value":{"email":"recorder@example.invalid","language":"en"}}}}}},"responses":{"200":{"description":"Existing invitation. A replay may return the saved request receipt.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"status":{"type":"string","enum":["sending","sent","failed","delivery_unknown"]},"created_at":{"type":"string","format":"date-time"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","status","created_at","sent_at"],"additionalProperties":false},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"examples":{"existing":{"value":{"id":"invite_demo_01","status":"sent","created_at":"2027-03-02T16:30:00Z","sent_at":"2027-03-02T16:30:00Z"}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"201":{"description":"Email accepted by the sender.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"status":{"type":"string","enum":["sent"]},"sent_at":{"type":"string","format":"date-time"}},"required":["id","status","sent_at"],"additionalProperties":false},"examples":{"sent":{"value":{"id":"invite_demo_01","status":"sent","sent_at":"2027-03-02T16:30:00Z"}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Delivery is uncertain. Check the invitation status before retrying. A replay may return the saved request receipt.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"status":{"type":"string","enum":["delivery_unknown"]}},"required":["id","status"],"additionalProperties":false},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"examples":{"uncertain":{"value":{"id":"invite_demo_01","status":"delivery_unknown"}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/recorders":{"get":{"tags":["Companies"],"operationId":"listCompanyRecorders","summary":"List linked recorders","description":"Returns provider accounts linked to this active enrollment with independent company membership evidence. last_recorded_on is the Arizona calendar date of the latest upload attributable to this company and recorder. first_30_uploaded_at records when their cumulative attributable uploads reached 30 minutes. first_upload_at and last_upload_at are attributable upload times. first_accepted_at is the earliest observed Minute decision among attributable uploads that are currently accepted and present.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"name":"after","in":"query","required":false,"schema":{"type":"string","maxLength":180},"description":"Pass the previous page’s next_cursor unchanged. Omit for the first page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Maximum number of results in this page."}],"responses":{"200":{"description":"A page in ascending ID order. A null next_cursor ends the list.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"status":{"type":"string","enum":["active","test","disabled","removed"]},"joined_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"last_recorded_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"first_30_uploaded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"kit_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"first_upload_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_upload_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"first_accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","status","joined_on","last_recorded_on","first_30_uploaded_at","kit_id","first_upload_at","last_upload_at","first_accepted_at"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"after":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor","after"],"additionalProperties":false},"examples":{"page":{"value":{"items":[{"id":"recorder_demo_01","status":"active","joined_on":"2027-03-02","last_recorded_on":null,"first_30_uploaded_at":null,"kit_id":"kit_demo_01","first_upload_at":null,"last_upload_at":null,"first_accepted_at":null}],"next_cursor":null,"after":null}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"410":{"description":"The company has closed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false},"examples":{"refused":{"value":{"error":"The company has closed."}}}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/kits":{"get":{"tags":["Equipment"],"operationId":"listCompanyKits","summary":"List assigned equipment","description":"Read equipment currently assigned to the company. recorder_id identifies a recorded handoff. setup_at reflects setup confirmation and training_passed_at reflects a recorded training pass. Upload and acceptance milestones are scoped to the company and dated handoff. first_accepted_at includes only currently accepted, present uploads.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"name":"after","in":"query","required":false,"schema":{"type":"string","maxLength":180},"description":"Pass the previous page’s next_cursor unchanged. Omit for the first page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Maximum number of results in this page."}],"responses":{"200":{"description":"A page in ascending ID order. A null next_cursor ends the list.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"label":{"type":"string"},"kind":{"type":"string","enum":["phone","headset","camera","mount","other"]},"model":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["assigned"]},"assigned_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"recorder_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"assigned_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"setup_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"training_passed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"first_upload_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"last_upload_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"first_accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","label","kind","model","status","assigned_on","recorder_id","assigned_at","setup_at","training_passed_at","first_upload_at","last_upload_at","first_accepted_at"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"after":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor","after"],"additionalProperties":false},"examples":{"page":{"value":{"items":[{"id":"kit_demo_01","label":"Example kit","kind":"phone","model":null,"status":"assigned","assigned_on":"2027-03-02","recorder_id":"recorder_demo_01","assigned_at":"2027-03-02T16:30:00Z","setup_at":"2027-03-02T16:30:00Z","training_passed_at":null,"first_upload_at":null,"last_upload_at":null,"first_accepted_at":null}],"next_cursor":null,"after":null}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"410":{"description":"The company has closed.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false},"examples":{"refused":{"value":{"error":"The company has closed."}}}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/kits/{kit_id}/assignment":{"put":{"tags":["Equipment"],"operationId":"assignCompanyKit","summary":"Assign a kit phone to a recorder","description":"Use an assigned phone from GET /kits and an active account from GET /recorders for the same company. To move a phone, provide the current account as previous_recorder_id and the receiving account as recorder_id. Set setup_complete to true after setup has been confirmed. Confirming setup again preserves the original timestamp.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"name":"kit_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"An assigned phone ID from this company's GET /kits."},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"},"description":"One key per intended change within this OAuth connection. Reuse only with the original method, path, query and JSON body."}],"requestBody":{"required":true,"description":"Recorder handoff and optional setup confirmation.","content":{"application/json":{"schema":{"type":"object","properties":{"recorder_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"previous_recorder_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"setup_complete":{"type":"boolean"}},"required":["recorder_id"],"additionalProperties":false},"examples":{"handoff":{"value":{"recorder_id":"recorder_demo_01","setup_complete":true}},"reassign":{"value":{"previous_recorder_id":"recorder_demo_01","recorder_id":"recorder_demo_02"}}}}}},"responses":{"200":{"description":"Current dated assignment. A replay may return the saved request receipt.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"assigned_at":{"type":"string","format":"date-time"},"setup_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","assigned_at","setup_at"],"additionalProperties":false},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"examples":{"assigned":{"value":{"id":"assignment_demo_01","assigned_at":"2027-03-02T16:30:00Z","setup_at":"2027-03-02T16:30:00Z"}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Operation receipt on retry. Inspect http_status and fetch the current resource.","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"The specified phone, recorder or prior assignment is unavailable.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false},"examples":{"refused":{"value":{"error":"The phone or recorder is unavailable for this company assignment."}}}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/kit-orders":{"get":{"tags":["Equipment"],"operationId":"listCompanyKitOrders","summary":"Track kit orders","description":"Read this company's quantity, order decision, replacement references, and shipment contents when fulfillment has begun.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"name":"after","in":"query","required":false,"schema":{"type":"string","maxLength":180},"description":"Pass the previous page’s next_cursor unchanged. Omit for the first page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Maximum number of results in this page."}],"responses":{"200":{"description":"A page in ascending ID order. A null next_cursor ends the list.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"item":{"type":"string","enum":["kit","straps"]},"company_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"kind":{"type":"string","enum":["new","replacement"]},"kits":{"type":"integer","minimum":1},"status":{"type":"string","enum":["waiting_contract","exception","asked","approved","declined","canceled"]},"report_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"replaces_kit_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"shipment_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"decided_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"shipment":{"anyOf":[{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"name":{"type":"string"},"category":{"type":"string"},"quantity":{"type":"integer","minimum":1}},"required":["item_id","name","category","quantity"],"additionalProperties":false}},"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"status":{"type":"string","enum":["to_send","packing","shipped","delivered","canceled"]},"carrier":{"anyOf":[{"type":"string"},{"type":"null"}]},"tracking":{"anyOf":[{"type":"string"},{"type":"null"}]},"shipped_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"delivered_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]}},"required":["items","id","status","carrier","tracking","shipped_on","delivered_on"],"additionalProperties":false},{"type":"null"}]}},"required":["id","item","company_id","kind","kits","status","report_id","replaces_kit_id","shipment_id","created_at","updated_at","decided_at","shipment"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"after":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor","after"],"additionalProperties":false},"examples":{"page":{"value":{"items":[{"item":"kit","id":"order_demo_01","company_id":"org_demo_01","kind":"new","kits":2,"status":"approved","report_id":null,"replaces_kit_id":null,"shipment_id":"shipment_demo_01","created_at":"2027-03-02T16:30:00Z","updated_at":"2027-03-02T16:30:00Z","decided_at":"2027-03-02T16:30:00Z","shipment":{"id":"shipment_demo_01","status":"shipped","carrier":"Example carrier","tracking":"EXAMPLE-TRACKING-01","shipped_on":"2027-03-02","delivered_on":null,"items":[{"item_id":"item_demo_01","name":"Kit phone","category":"phone","quantity":2}]}}],"next_cursor":null,"after":null}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Equipment"],"operationId":"placeCompanyKitOrder","summary":"Request kits or a replacement","description":"Requires kit ordering to be enabled for the account. New orders need a shipping address on file or ship_to in the request. A supplied address is saved for the company. For a replacement, report the affected kit first and pass the report_id. item identifies phone kits or straps according to the company's program. An order decision and a shipment are separate stages.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"},"description":"One key per intended change within this OAuth connection. Reuse only with the original method, path, query and JSON body."}],"requestBody":{"required":true,"description":"Order quantity, purpose and destination.","content":{"application/json":{"schema":{"type":"object","properties":{"kits":{"type":"integer","minimum":1,"maximum":6},"kind":{"type":"string","enum":["new","replacement"],"default":"new"},"report_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"account_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"maxItems":6},"ship_to":{"type":"object","properties":{"line1":{"type":"string","maxLength":200},"line2":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"city":{"type":"string","maxLength":100},"state":{"type":"string","maxLength":2,"pattern":"^[A-Za-z]{2}$"},"postal_code":{"type":"string","maxLength":10,"pattern":"^[0-9]{5}(-[0-9]{4})?$"}},"required":["line1","city","state","postal_code"],"additionalProperties":false}},"required":["kits"],"additionalProperties":false,"allOf":[{"if":{"properties":{"kind":{"const":"replacement"}},"required":["kind"]},"then":{"required":["report_id"]}}]},"examples":{"newOrder":{"value":{"kits":2,"kind":"new","ship_to":{"line1":"100 Example Way","city":"Example City","state":"AZ","postal_code":"85001"}}},"replacement":{"value":{"kits":1,"kind":"replacement","report_id":"report_demo_01"}}}}}},"responses":{"200":{"description":"Order and eligibility checks. A replay may return the saved request receipt.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"order":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"status":{"type":"string","enum":["waiting_contract","exception","asked","approved","declined","canceled"]},"item":{"type":"string","enum":["kit","straps"]},"checks":{"type":"array","items":{"type":"object","properties":{"rule":{"type":"string","enum":["order_form","recorders","idle","limit","partner_cap","replacement"]},"met":{"anyOf":[{"type":"boolean"},{"type":"null"}]},"detail":{"type":"string"}},"required":["rule","met","detail"],"additionalProperties":false}},"reasons":{"type":"array","items":{"type":"string"}}},"required":["id","status","item","checks","reasons"],"additionalProperties":false}},"required":["order"],"additionalProperties":false},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"examples":{"approved":{"value":{"order":{"id":"order_demo_01","status":"approved","item":"kit","checks":[{"rule":"order_form","met":true,"detail":"Order form signed."}],"reasons":[]}}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Operation receipt on retry. Inspect http_status and fetch the current resource.","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/kit-orders/{order_id}":{"get":{"tags":["Equipment"],"operationId":"getCompanyKitOrder","summary":"Read one kit order","description":"Poll the order ID returned by POST /kit-orders under the same company. The embedded shipment describes what was dispatched and its delivery status.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"name":"order_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The ID in the order response or kit order list."}],"responses":{"200":{"description":"Current company order.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"item":{"type":"string","enum":["kit","straps"]},"company_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"kind":{"type":"string","enum":["new","replacement"]},"kits":{"type":"integer","minimum":1},"status":{"type":"string","enum":["waiting_contract","exception","asked","approved","declined","canceled"]},"report_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"replaces_kit_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"shipment_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"decided_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"shipment":{"anyOf":[{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"name":{"type":"string"},"category":{"type":"string"},"quantity":{"type":"integer","minimum":1}},"required":["item_id","name","category","quantity"],"additionalProperties":false}},"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"status":{"type":"string","enum":["to_send","packing","shipped","delivered","canceled"]},"carrier":{"anyOf":[{"type":"string"},{"type":"null"}]},"tracking":{"anyOf":[{"type":"string"},{"type":"null"}]},"shipped_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"delivered_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]}},"required":["items","id","status","carrier","tracking","shipped_on","delivered_on"],"additionalProperties":false},{"type":"null"}]}},"required":["id","item","company_id","kind","kits","status","report_id","replaces_kit_id","shipment_id","created_at","updated_at","decided_at","shipment"],"additionalProperties":false},"examples":{"order":{"value":{"item":"kit","id":"order_demo_01","company_id":"org_demo_01","kind":"new","kits":2,"status":"approved","report_id":null,"replaces_kit_id":null,"shipment_id":"shipment_demo_01","created_at":"2027-03-02T16:30:00Z","updated_at":"2027-03-02T16:30:00Z","decided_at":"2027-03-02T16:30:00Z","shipment":{"id":"shipment_demo_01","status":"shipped","carrier":"Example carrier","tracking":"EXAMPLE-TRACKING-01","shipped_on":"2027-03-02","delivered_on":null,"items":[{"item_id":"item_demo_01","name":"Kit phone","category":"phone","quantity":2}]}}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/kit-reports":{"get":{"tags":["Equipment"],"operationId":"listCompanyKitReports","summary":"Track reported kit problems","description":"Read the affected kit, current resolution status and any linked replacement order.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"name":"after","in":"query","required":false,"schema":{"type":"string","maxLength":180},"description":"Pass the previous page’s next_cursor unchanged. Omit for the first page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Maximum number of results in this page."}],"responses":{"200":{"description":"A page in ascending ID order. A null next_cursor ends the list.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"company_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"kit_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"problem":{"type":"string","enum":["wont_charge","screen_broken","no_service","part_missing","lost","other"]},"status":{"type":"string","enum":["open","replacing","closed"]},"replacement_order_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","company_id","kit_id","problem","status","replacement_order_id","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"after":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor","after"],"additionalProperties":false},"examples":{"page":{"value":{"items":[{"id":"report_demo_01","company_id":"org_demo_01","kit_id":"kit_demo_01","problem":"wont_charge","status":"open","replacement_order_id":null,"created_at":"2027-03-02T16:30:00Z","updated_at":"2027-03-02T16:30:00Z"}],"next_cursor":null,"after":null}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Equipment"],"operationId":"reportCompanyKitProblem","summary":"Report a kit problem","description":"Requires kit ordering to be enabled. Use a phone ID from this company's GET /kits. Save the returned report ID to request a replacement. An existing open report for that phone is reused.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"},"description":"One key per intended change within this OAuth connection. Reuse only with the original method, path, query and JSON body."}],"requestBody":{"required":true,"description":"Affected phone and observed issue.","content":{"application/json":{"schema":{"type":"object","properties":{"device_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"problem":{"type":"string","enum":["wont_charge","screen_broken","no_service","part_missing","lost","other"]},"note":{"type":"string","maxLength":2000}},"required":["device_id","problem"],"additionalProperties":false},"examples":{"report":{"value":{"device_id":"kit_demo_01","problem":"wont_charge","note":"The phone does not charge with the supplied cable."}}}}}},"responses":{"200":{"description":"New or existing problem report. A replay may return the saved request receipt.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"report":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"}},"required":["id"],"additionalProperties":false}},"required":["report"],"additionalProperties":false},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"examples":{"reported":{"value":{"report":{"id":"report_demo_01"}}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Operation receipt on retry. Inspect http_status and fetch the current resource.","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/kit-reports/{report_id}":{"get":{"tags":["Equipment"],"operationId":"getCompanyKitReport","summary":"Read one kit problem report","description":"Poll the report returned by POST /kit-reports under the same company. Use replacement_order_id when present to track the replacement.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"name":"report_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The ID in the report response or kit report list."}],"responses":{"200":{"description":"Current company kit report.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"company_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"kit_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"problem":{"type":"string","enum":["wont_charge","screen_broken","no_service","part_missing","lost","other"]},"status":{"type":"string","enum":["open","replacing","closed"]},"replacement_order_id":{"anyOf":[{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","company_id","kit_id","problem","status","replacement_order_id","created_at","updated_at"],"additionalProperties":false},"examples":{"report":{"value":{"id":"report_demo_01","company_id":"org_demo_01","kit_id":"kit_demo_01","problem":"wont_charge","status":"open","replacement_order_id":null,"created_at":"2027-03-02T16:30:00Z","updated_at":"2027-03-02T16:30:00Z"}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/shipments":{"get":{"tags":["Equipment"],"operationId":"listCompanyShipments","summary":"Track company shipments","description":"Read the fulfillment status, tracking reference and recorded shipping and delivery dates. Use kit assignments to track setup after delivery.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"name":"after","in":"query","required":false,"schema":{"type":"string","maxLength":180},"description":"Pass the previous page’s next_cursor unchanged. Omit for the first page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Maximum number of results in this page."}],"responses":{"200":{"description":"A page in ascending ID order. A null next_cursor ends the list.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"name":{"type":"string"},"category":{"type":"string"},"quantity":{"type":"integer","minimum":1}},"required":["item_id","name","category","quantity"],"additionalProperties":false}},"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"status":{"type":"string","enum":["to_send","packing","shipped","delivered","canceled"]},"carrier":{"anyOf":[{"type":"string"},{"type":"null"}]},"tracking":{"anyOf":[{"type":"string"},{"type":"null"}]},"shipped_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"delivered_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]}},"required":["items","id","status","carrier","tracking","shipped_on","delivered_on"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"after":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor","after"],"additionalProperties":false},"examples":{"page":{"value":{"items":[{"id":"shipment_demo_01","status":"shipped","carrier":"Example carrier","tracking":"EXAMPLE-TRACKING-01","shipped_on":"2027-03-02","delivered_on":null,"items":[{"item_id":"item_demo_01","name":"Kit phone","category":"phone","quantity":2}]}],"next_cursor":null,"after":null}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/shipments/{shipment_id}":{"get":{"tags":["Equipment"],"operationId":"getCompanyShipment","summary":"Read one shipment","description":"Use the shipment_id in an order or the id from the company shipment list. The response includes the shipped line items and the available delivery dates.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"name":"shipment_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"A shipment belonging to this company."}],"responses":{"200":{"description":"Current company shipment.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"name":{"type":"string"},"category":{"type":"string"},"quantity":{"type":"integer","minimum":1}},"required":["item_id","name","category","quantity"],"additionalProperties":false}},"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"status":{"type":"string","enum":["to_send","packing","shipped","delivered","canceled"]},"carrier":{"anyOf":[{"type":"string"},{"type":"null"}]},"tracking":{"anyOf":[{"type":"string"},{"type":"null"}]},"shipped_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]},"delivered_on":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}]}},"required":["items","id","status","carrier","tracking","shipped_on","delivered_on"],"additionalProperties":false},"examples":{"shipment":{"value":{"id":"shipment_demo_01","status":"shipped","carrier":"Example carrier","tracking":"EXAMPLE-TRACKING-01","shipped_on":"2027-03-02","delivered_on":null,"items":[{"item_id":"item_demo_01","name":"Kit phone","category":"phone","quantity":2}]}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/kit-returns":{"get":{"tags":["Equipment"],"operationId":"listCompanyKitReturns","summary":"Track kit returns","description":"A requested return stays open until receipt of the assigned device is recorded.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"name":"after","in":"query","required":false,"schema":{"type":"string","maxLength":180},"description":"Pass the previous page’s next_cursor unchanged. Omit for the first page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Maximum number of results in this page."}],"responses":{"200":{"description":"A page in ascending ID order. A null next_cursor ends the list.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"state":{"type":"string","enum":["requested","received","canceled"]},"reason":{"type":"string","maxLength":1000},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"kit_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"}},"required":["id","state","reason","created_at","updated_at","kit_id"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"after":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor","after"],"additionalProperties":false},"examples":{"page":{"value":{"items":[{"id":"return_demo_01","kit_id":"kit_demo_01","state":"requested","reason":"The crew finished this site.","created_at":"2027-03-02T16:30:00Z","updated_at":"2027-03-02T16:30:00Z"}],"next_cursor":null,"after":null}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Equipment"],"operationId":"requestCompanyKitReturn","summary":"Request a kit return","description":"Use the ID of a currently assigned kit and explain the return. Poll GET /kit-returns for receipt. This action remains available while the company is closing.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"},"description":"One key per intended change within this OAuth connection. Reuse only with the original method, path, query and JSON body."}],"requestBody":{"required":true,"description":"Kit and reason.","content":{"application/json":{"schema":{"type":"object","properties":{"kit_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"device_id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$","description":"Alias for kit_id."},"reason":{"type":"string","maxLength":1000,"minLength":1}},"required":["reason"],"additionalProperties":false,"anyOf":[{"required":["kit_id"]},{"required":["device_id"]}]},"examples":{"request":{"value":{"kit_id":"kit_demo_01","reason":"The crew finished this site."}}}}}},"responses":{"200":{"description":"Matching open return already exists. A replay may return the saved request receipt.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"state":{"type":"string","enum":["requested","closed"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","state","created_at"],"additionalProperties":false},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"examples":{"existing":{"value":{"id":"return_demo_01","state":"requested","created_at":"2027-03-02T16:30:00Z"}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"201":{"description":"Return opened.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"state":{"type":"string","enum":["requested","closed"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","state","created_at"],"additionalProperties":false},"examples":{"requested":{"value":{"id":"return_demo_01","state":"requested","created_at":"2027-03-02T16:30:00Z"}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Operation receipt on retry. Inspect http_status and fetch the current resource.","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/companies/{company_id}/closure-requests":{"get":{"tags":["Companies"],"operationId":"listCompanyClosureRequests","summary":"Track closure requests","description":"Read the company's exit status. The request remains open while equipment, enrollment retirement or settlement is outstanding.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"name":"after","in":"query","required":false,"schema":{"type":"string","maxLength":180},"description":"Pass the previous page’s next_cursor unchanged. Omit for the first page."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"description":"Maximum number of results in this page."}],"responses":{"200":{"description":"A page in ascending ID order. A null next_cursor ends the list.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"state":{"type":"string","enum":["requested","closed","canceled"]},"reason":{"type":"string","maxLength":1000},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","state","reason","created_at","updated_at"],"additionalProperties":false}},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}]},"after":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["items","next_cursor","after"],"additionalProperties":false},"examples":{"page":{"value":{"items":[{"id":"closure_demo_01","state":"requested","reason":"The company finished the recording program.","created_at":"2027-03-02T16:30:00Z","updated_at":"2027-03-02T16:30:00Z"}],"next_cursor":null,"after":null}}}}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"The signed account or role lacks access to this operation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Companies"],"operationId":"requestCompanyClosure","summary":"Request company closure","description":"Owner access is required. A closure request stops new provisioning, invitations, assignments and kit orders. Closure processing checks equipment returns, code retirement, buyer review and settlement. Poll the closure request or onboarding summary for the final state.","parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"The partner_company_id from registration, or the operating_company_id of a signed, credited company."},{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"},"description":"One key per intended change within this OAuth connection. Reuse only with the original method, path, query and JSON body."}],"requestBody":{"required":true,"description":"Reason for closing.","content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":1000,"minLength":1}},"required":["reason"],"additionalProperties":false},"examples":{"request":{"value":{"reason":"The company finished the recording program."}}}}}},"responses":{"200":{"description":"Matching request or completed closure. A replay may return the saved request receipt.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"state":{"type":"string","enum":["requested","closed"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","state","created_at"],"additionalProperties":false},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"examples":{"closed":{"value":{"id":"closure_demo_01","state":"closed","created_at":"2027-03-02T16:30:00Z"}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"201":{"description":"Closure requested.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":160,"pattern":"^[A-Za-z0-9._:-]+$"},"state":{"type":"string","enum":["requested","closed"]},"created_at":{"type":"string","format":"date-time"}},"required":["id","state","created_at"],"additionalProperties":false},"examples":{"requested":{"value":{"id":"closure_demo_01","state":"requested","created_at":"2027-03-02T16:30:00Z"}}}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Operation receipt on retry. Inspect http_status and fetch the current resource.","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["processing","complete","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. Correct the request and use a new key for changed input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing, expired, revoked or wrong-resource access token.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Only the partner account owner can request closure.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"],"additionalProperties":false},"examples":{"refused":{"value":{"error":"The account owner requests closure."}}}}}},"404":{"description":"The resource is unknown or outside this account.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit reached. Back off and retry.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Service or provider unavailable. Check the operation receipt before retrying a write.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}}}}},"/api/partner/v1/recordings":{"get":{"operationId":"listPartnerRecordings","tags":["Recording and QA"],"summary":"List attributed recordings","description":"Returns recording metadata for the active company grant, ordered by recording ID. Minute provides buyer decisions and reasons. Jev provides Colby’s independent coaching assessment. A recording can be pending with a completed Jev check. Available to the partner owner and authorized team members within their signed, directly credited operating companies.","parameters":[{"name":"company_id","in":"query","required":false,"schema":{"type":"string"},"description":"A company registration ID or its operating company ID. Returned company_id values are operating company IDs."},{"name":"recorder_id","in":"query","required":false,"schema":{"type":"string"},"description":"Restrict results to one attributed recorder."},{"name":"month","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"description":"Recording month in Phoenix time. Supply month on its own or use from and to."},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"First recording date to include, starting at midnight in Phoenix. May be used alone."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Last recording date to include, through the end of the day in Phoenix. May be used alone."},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Return the next page using the previous next_cursor with the same filters. A null next_cursor ends the list."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Maximum rows per page."}],"responses":{"200":{"description":"Recording page.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"recorder_id":{"type":"string"},"kit_id":{"type":["string","null"]},"recorded_at":{"type":"string","format":"date-time"},"uploaded_at":{"type":["string","null"],"format":"date-time"},"minutes":{"type":"number"},"task":{"type":["string","null"]},"minute":{"type":"object","properties":{"status":{"type":"string","enum":["unknown","pending","accepted","flagged"]},"status_at":{"type":["string","null"],"format":"date-time"},"removed_at":{"type":["string","null"],"format":"date-time"},"reasons":{"type":"array","items":{"type":"string"}},"last_seen_at":{"type":"string","format":"date-time"}},"required":["status","status_at","removed_at","reasons","last_seen_at"]},"jev":{"type":"object","properties":{"status":{"type":"string","enum":["unscored","queued","checked","failed"]},"request_status":{"type":["string","null"],"enum":["dispatching","queued","running","checked","failed",null]},"checked_at":{"type":["string","null"],"format":"date-time"},"verdict":{"type":["string","null"],"enum":["likely_accepted","likely_rejected",null]},"usability":{"type":["number","null"],"minimum":0,"maximum":4},"frames":{"type":["integer","null"]},"hands_frames":{"type":["integer","null"]},"dark_frames":{"type":["integer","null"]}},"required":["status","request_status","checked_at","verdict","usability","frames","hands_frames","dark_frames"]}},"required":["id","company_id","recorder_id","kit_id","recorded_at","uploaded_at","minutes","task","minute","jev"]}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]},"example":{"items":[{"id":"rec_demo","company_id":"org_demo","recorder_id":"recorder_demo","kit_id":"kit_demo","recorded_at":"2031-04-09T16:00:00Z","uploaded_at":"2031-04-09T16:18:00Z","minutes":12,"task":"Surface cleaning","minute":{"status":"pending","status_at":"2031-04-09T16:18:00Z","removed_at":null,"reasons":[],"last_seen_at":"2031-04-09T18:00:00Z"},"jev":{"status":"checked","request_status":"checked","checked_at":"2031-04-09T17:00:00Z","verdict":"likely_rejected","usability":1.5,"frames":8,"hands_frames":2,"dark_frames":1}}],"next_cursor":null}}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"This partner grant cannot access the workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}}},"/api/partner/v1/recordings/{id}":{"get":{"operationId":"getPartnerRecording","tags":["Recording and QA"],"summary":"Read one recording","description":"Read its attributed company, recorder and kit, latest Minute decision, removal time, and Jev evidence. A null kit_id means the kit assignment has not been established. Jev usability is scored from 0 through 4. Available to the partner owner and authorized team members within their signed, directly credited operating companies.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The stable recording ID from GET /recordings."}],"responses":{"200":{"description":"Recording details.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"recorder_id":{"type":"string"},"kit_id":{"type":["string","null"]},"recorded_at":{"type":"string","format":"date-time"},"uploaded_at":{"type":["string","null"],"format":"date-time"},"minutes":{"type":"number"},"task":{"type":["string","null"]},"minute":{"type":"object","properties":{"status":{"type":"string","enum":["unknown","pending","accepted","flagged"]},"status_at":{"type":["string","null"],"format":"date-time"},"removed_at":{"type":["string","null"],"format":"date-time"},"reasons":{"type":"array","items":{"type":"string"}},"last_seen_at":{"type":"string","format":"date-time"}},"required":["status","status_at","removed_at","reasons","last_seen_at"]},"jev":{"type":"object","properties":{"status":{"type":"string","enum":["unscored","queued","checked","failed"]},"request_status":{"type":["string","null"],"enum":["dispatching","queued","running","checked","failed",null]},"checked_at":{"type":["string","null"],"format":"date-time"},"verdict":{"type":["string","null"],"enum":["likely_accepted","likely_rejected",null]},"usability":{"type":["number","null"],"minimum":0,"maximum":4},"frames":{"type":["integer","null"]},"hands_frames":{"type":["integer","null"]},"dark_frames":{"type":["integer","null"]}},"required":["status","request_status","checked_at","verdict","usability","frames","hands_frames","dark_frames"]}},"required":["id","company_id","recorder_id","kit_id","recorded_at","uploaded_at","minutes","task","minute","jev"]},"example":{"id":"rec_demo","company_id":"org_demo","recorder_id":"recorder_demo","kit_id":"kit_demo","recorded_at":"2031-04-09T16:00:00Z","uploaded_at":"2031-04-09T16:18:00Z","minutes":12,"task":"Surface cleaning","minute":{"status":"pending","status_at":"2031-04-09T16:18:00Z","removed_at":null,"reasons":[],"last_seen_at":"2031-04-09T18:00:00Z"},"jev":{"status":"checked","request_status":"checked","checked_at":"2031-04-09T17:00:00Z","verdict":"likely_rejected","usability":1.5,"frames":8,"hands_frames":2,"dark_frames":1}}}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"This partner grant cannot access the workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}}},"/api/partner/v1/performance":{"get":{"operationId":"getPartnerPerformance","tags":["Recording and QA"],"summary":"Summarize recording performance","description":"Groups by company by default. Each item’s id identifies the selected group. Buyer buckets and removed_minutes account for the recorded minutes. uploaded_minutes overlaps those buckets. QA counts are recordings. qa_flagged counts Jev’s likely_rejected results. First-upload, first-accepted and source timestamps apply to the selected records. Available to the partner owner and authorized team members within their signed, directly credited operating companies.","parameters":[{"name":"group_by","in":"query","required":false,"schema":{"type":"string","enum":["partner","company","recorder"],"default":"company"},"description":"Group by partner, company or recorder."},{"name":"company_id","in":"query","required":false,"schema":{"type":"string"},"description":"A company registration ID or its operating company ID. Returned company_id values are operating company IDs."},{"name":"recorder_id","in":"query","required":false,"schema":{"type":"string"},"description":"Restrict results to one attributed recorder."},{"name":"month","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"description":"Recording month in Phoenix time. Supply month on its own or use from and to."},{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"First recording date to include, starting at midnight in Phoenix. May be used alone."},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date"},"description":"Last recording date to include, through the end of the day in Phoenix. May be used alone."},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Return the next page using the previous next_cursor with the same filters. A null next_cursor ends the list."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Maximum rows per page."}],"responses":{"200":{"description":"Performance totals with the applied grouping and page cursor.","content":{"application/json":{"schema":{"type":"object","properties":{"group_by":{"type":"string","enum":["partner","company","recorder"]},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"recordings":{"type":"integer"},"recorders":{"type":"integer"},"recorded_minutes":{"type":"number"},"uploaded_minutes":{"type":"number"},"accepted_minutes":{"type":"number"},"pending_minutes":{"type":"number"},"flagged_minutes":{"type":"number"},"unreviewed_minutes":{"type":"number"},"removed_minutes":{"type":"number"},"qa_checked":{"type":"integer"},"qa_flagged":{"type":"integer"},"qa_queued":{"type":"integer"},"qa_failed":{"type":"integer"},"qa_unscored":{"type":"integer"},"minute_as_of":{"type":["string","null"],"format":"date-time"},"qa_as_of":{"type":["string","null"],"format":"date-time"},"first_uploaded_at":{"type":["string","null"],"format":"date-time"},"first_accepted_at":{"type":["string","null"],"format":"date-time"}},"required":["id","recordings","recorders","recorded_minutes","uploaded_minutes","accepted_minutes","pending_minutes","flagged_minutes","unreviewed_minutes","removed_minutes","qa_checked","qa_flagged","qa_queued","qa_failed","qa_unscored","minute_as_of","qa_as_of","first_uploaded_at","first_accepted_at"]}},"next_cursor":{"type":["string","null"]}},"required":["group_by","items","next_cursor"]},"example":{"group_by":"company","items":[{"id":"org_demo","recordings":1,"recorders":1,"recorded_minutes":12,"uploaded_minutes":12,"accepted_minutes":0,"pending_minutes":12,"flagged_minutes":0,"unreviewed_minutes":0,"removed_minutes":0,"qa_checked":1,"qa_flagged":1,"qa_queued":0,"qa_failed":0,"qa_unscored":0,"minute_as_of":"2031-04-09T18:00:00Z","qa_as_of":"2031-04-09T17:00:00Z","first_uploaded_at":"2031-04-09T16:18:00Z","first_accepted_at":null}],"next_cursor":null}}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"This partner grant cannot access the workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}}},"/api/partner/v1/recordings/{id}/qa-requests":{"post":{"operationId":"requestRecordingQa","tags":["Recording and QA"],"summary":"Request a Jev recheck","description":"Queue a quality check on the recording’s available Colby copy. A request already in progress returns its existing ID. Poll /qa-requests/{id}, then fetch the recording for the result. A failed recheck preserves the previous successful score. Available to the partner owner and authorized team members within their signed, directly credited operating companies.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The stable recording ID from GET /recordings."},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Choose a unique key for this intended action. Retry the same method, path, query and body with the original key. Replays return an operation receipt."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"An existing request or completed replay. An identical replay receives a receipt. Check its http_status and result, then retrieve the resource. A processing or reconcile receipt returns 202.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"recording_id":{"type":"string"},"status":{"type":"string","enum":["dispatching","queued","running","checked","failed"]}},"required":["id","recording_id","status"]},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["complete","processing","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"example":{"id":"qa_demo","recording_id":"rec_demo","status":"queued"}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"The QA request was accepted or is already underway. An identical replay receives a receipt. Check its http_status and result, then retrieve the resource. A processing or reconcile receipt returns 202.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"recording_id":{"type":"string"},"status":{"type":"string","enum":["dispatching","queued","running","checked","failed"]}},"required":["id","recording_id","status"]},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["complete","processing","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"example":{"id":"qa_demo","recording_id":"rec_demo","status":"queued"}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"This partner grant cannot access the workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"The copy is pending, another request conflicts, or the idempotency key belongs to different input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"copy_pending"}}}},"413":{"description":"The request body exceeds the permitted size.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"request_too_large"}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"The QA service is unavailable or dispatch failed. A saved request may include its id.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"qa_unavailable"}}}}}}},"/api/partner/v1/qa-requests/{id}":{"get":{"operationId":"getPartnerQaRequest","tags":["Recording and QA"],"summary":"Read the status of a QA request","description":"Use the request ID returned by the recheck action or a QA request event. checked and failed are terminal states for this request. Read the recording for the score and verdict. Available to the partner owner and authorized team members within their signed, directly credited operating companies.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The QA request ID."}],"responses":{"200":{"description":"Request status and timestamps.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"recording_id":{"type":"string"},"status":{"type":"string","enum":["dispatching","queued","running","checked","failed"]},"company_id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","recording_id","status","company_id","created_at","updated_at"]},"example":{"id":"qa_demo","recording_id":"rec_demo","status":"checked","company_id":"org_demo","created_at":"2031-04-09T16:40:00Z","updated_at":"2031-04-09T17:00:00Z"}}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"This partner grant cannot access the workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}}},"/api/partner/v1/feedback":{"get":{"operationId":"listPartnerFeedback","tags":["Feedback"],"summary":"List coaching issues","description":"Filter the coaching queue by company and issue status. Items are ordered by feedback ID. Available to the partner owner and authorized team members within their signed, directly credited operating companies.","parameters":[{"name":"company_id","in":"query","required":false,"schema":{"type":"string"},"description":"A company registration ID or its operating company ID. Returned company_id values are operating company IDs."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","acknowledged","resolved"]},"description":"Restrict the list to one issue status."},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Return the next page using the previous next_cursor with the same filters. A null next_cursor ends the list."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Maximum rows per page."}],"responses":{"200":{"description":"Feedback page.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"recording_id":{"type":"string","minLength":1,"maxLength":128},"recipient":{"type":"string","enum":["recorder","site_lead"]},"message":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["open","acknowledged","resolved"]},"follow_up_recording_id":{"type":["string","null"]},"resolution_note":{"type":["string","null"]},"version":{"type":"integer","minimum":1},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","company_id","recording_id","recipient","message","status","follow_up_recording_id","resolution_note","version","created_at","updated_at"]}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]},"example":{"items":[{"id":"fb_demo","company_id":"org_demo","recording_id":"rec_demo","recipient":"site_lead","message":"Keep both hands and the work surface in frame.","status":"open","follow_up_recording_id":null,"resolution_note":null,"version":1,"created_at":"2031-04-09T18:05:00Z","updated_at":"2031-04-09T18:05:00Z"}],"next_cursor":null}}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"This partner grant cannot access the workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}},"post":{"operationId":"createPartnerFeedback","tags":["Feedback"],"summary":"Create a coaching issue","description":"Attach a coaching message to an attributed recording and select the recorder or site lead as its recipient. The issue opens immediately. Use the deliveries action to send it. Available to the partner owner and authorized team members within their signed, directly credited operating companies.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Choose a unique key for this intended action. Retry the same method, path, query and body with the original key. Replays return an operation receipt."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"recording_id":{"type":"string","minLength":1,"maxLength":128},"recipient":{"type":"string","enum":["recorder","site_lead"]},"message":{"type":"string","minLength":1,"maxLength":2000}},"required":["recording_id","recipient","message"]},"example":{"recording_id":"rec_demo","recipient":"site_lead","message":"Keep both hands and the work surface in frame."}}}},"responses":{"200":{"description":"Existing issue or replay receipt. An identical replay receives a receipt. Check its http_status and result, then retrieve the resource. A processing or reconcile receipt returns 202.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"recording_id":{"type":"string","minLength":1,"maxLength":128},"recipient":{"type":"string","enum":["recorder","site_lead"]},"message":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["open","acknowledged","resolved"]},"follow_up_recording_id":{"type":["string","null"]},"resolution_note":{"type":["string","null"]},"version":{"type":"integer","minimum":1},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","company_id","recording_id","recipient","message","status","follow_up_recording_id","resolution_note","version","created_at","updated_at"]},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["complete","processing","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"example":{"id":"fb_demo","company_id":"org_demo","recording_id":"rec_demo","recipient":"site_lead","message":"Keep both hands and the work surface in frame.","status":"open","follow_up_recording_id":null,"resolution_note":null,"version":1,"created_at":"2031-04-09T18:05:00Z","updated_at":"2031-04-09T18:05:00Z"}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"201":{"description":"New coaching issue.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"recording_id":{"type":"string","minLength":1,"maxLength":128},"recipient":{"type":"string","enum":["recorder","site_lead"]},"message":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["open","acknowledged","resolved"]},"follow_up_recording_id":{"type":["string","null"]},"resolution_note":{"type":["string","null"]},"version":{"type":"integer","minimum":1},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","company_id","recording_id","recipient","message","status","follow_up_recording_id","resolution_note","version","created_at","updated_at"]},"example":{"id":"fb_demo","company_id":"org_demo","recording_id":"rec_demo","recipient":"site_lead","message":"Keep both hands and the work surface in frame.","status":"open","follow_up_recording_id":null,"resolution_note":null,"version":1,"created_at":"2031-04-09T18:05:00Z","updated_at":"2031-04-09T18:05:00Z"}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Replay of a processing or uncertain operation. Poll its request receipt.","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["complete","processing","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]},"example":{"request_id":"req_demo","state":"processing","http_status":null,"result":null}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"This partner grant cannot access the workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"This Idempotency-Key belongs to a different request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"idempotency_key_conflict"}}}},"413":{"description":"The request body exceeds the permitted size.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"request_too_large"}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}}},"/api/partner/v1/feedback/{id}":{"get":{"operationId":"getPartnerFeedback","tags":["Feedback"],"summary":"Read a coaching issue","description":"Returns the current status, version and resolution evidence. Available to the partner owner and authorized team members within their signed, directly credited operating companies.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The feedback issue ID from GET /feedback or the create response."}],"responses":{"200":{"description":"Coaching issue.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"recording_id":{"type":"string","minLength":1,"maxLength":128},"recipient":{"type":"string","enum":["recorder","site_lead"]},"message":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["open","acknowledged","resolved"]},"follow_up_recording_id":{"type":["string","null"]},"resolution_note":{"type":["string","null"]},"version":{"type":"integer","minimum":1},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","company_id","recording_id","recipient","message","status","follow_up_recording_id","resolution_note","version","created_at","updated_at"]},"example":{"id":"fb_demo","company_id":"org_demo","recording_id":"rec_demo","recipient":"site_lead","message":"Keep both hands and the work surface in frame.","status":"open","follow_up_recording_id":null,"resolution_note":null,"version":1,"created_at":"2031-04-09T18:05:00Z","updated_at":"2031-04-09T18:05:00Z"}}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"This partner grant cannot access the workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}},"patch":{"operationId":"updatePartnerFeedback","tags":["Feedback"],"summary":"Acknowledge or resolve a coaching issue","description":"An issue can move from open to acknowledged or resolved. Include its current version to detect conflicting updates. Resolution needs a note or a later recording from the same recorder and company, uploaded after the issue opened. A resolved issue is closed to further edits. Available to the partner owner and authorized team members within their signed, directly credited operating companies.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The feedback issue ID from GET /feedback or the create response."},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Choose a unique key for this intended action. Retry the same method, path, query and body with the original key. Replays return an operation receipt."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"const":"acknowledged"},"version":{"type":"integer","minimum":1}},"required":["status"]},{"type":"object","properties":{"status":{"const":"resolved"},"version":{"type":"integer","minimum":1},"follow_up_recording_id":{"type":"string","minLength":1,"maxLength":128},"resolution_note":{"type":"string","minLength":1,"maxLength":1000}},"required":["status"],"anyOf":[{"required":["follow_up_recording_id"]},{"required":["resolution_note"]}]}]},"example":{"status":"resolved","version":1,"follow_up_recording_id":"rec_followup_demo"}}}},"responses":{"200":{"description":"Updated issue. An identical replay receives a receipt. Check its http_status and result, then retrieve the resource. A processing or reconcile receipt returns 202.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"recording_id":{"type":"string","minLength":1,"maxLength":128},"recipient":{"type":"string","enum":["recorder","site_lead"]},"message":{"type":"string","minLength":1,"maxLength":2000},"status":{"type":"string","enum":["open","acknowledged","resolved"]},"follow_up_recording_id":{"type":["string","null"]},"resolution_note":{"type":["string","null"]},"version":{"type":"integer","minimum":1},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","company_id","recording_id","recipient","message","status","follow_up_recording_id","resolution_note","version","created_at","updated_at"]},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["complete","processing","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"example":{"id":"fb_demo","company_id":"org_demo","recording_id":"rec_demo","recipient":"site_lead","message":"Keep both hands and the work surface in frame.","status":"resolved","follow_up_recording_id":"rec_followup_demo","resolution_note":null,"version":2,"created_at":"2031-04-09T18:05:00Z","updated_at":"2031-04-10T18:00:00Z"}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Replay of a processing or uncertain operation. Poll its request receipt.","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["complete","processing","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]},"example":{"request_id":"req_demo","state":"processing","http_status":null,"result":null}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"This partner grant cannot access the workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"The version changed, the issue is resolved, the follow-up evidence conflicts, or the key belongs to different input.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"version_conflict"}}}},"413":{"description":"The request body exceeds the permitted size.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"request_too_large"}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}}},"/api/partner/v1/feedback/{id}/deliveries":{"get":{"operationId":"listPartnerFeedbackDeliveries","tags":["Feedback"],"summary":"List deliveries for an issue","description":"Returns one row per recorded delivery attempt, ordered by delivery ID. sent confirms submission. The issue’s acknowledgement is recorded separately. Available to the partner owner and authorized team members within their signed, directly credited operating companies.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The feedback issue ID from GET /feedback or the create response."},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Return the next page using the previous next_cursor with the same filters. A null next_cursor ends the list."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Maximum rows per page."}],"responses":{"200":{"description":"Delivery page.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"feedback_id":{"type":["string","null"]},"kind":{"type":"string","enum":["coaching","payee_setup"]},"status":{"type":"string","enum":["sending","sent","reconcile","failed"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","company_id","feedback_id","kind","status","created_at","updated_at"]}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]},"example":{"items":[{"id":"delivery_demo","company_id":"org_demo","feedback_id":"fb_demo","kind":"coaching","status":"sent","created_at":"2031-04-09T18:07:00Z","updated_at":"2031-04-09T18:07:01Z"}],"next_cursor":null}}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"This partner grant cannot access the workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}},"post":{"operationId":"sendPartnerFeedback","tags":["Feedback"],"summary":"Deliver a coaching message","description":"Send the issue’s message by email to the verified recipient already associated with it. Omit contact addresses. Existing sending or reconcile deliveries block another send. A sent delivery blocks another send for the same issue for 24 hours. For an uncertain result, poll deliveries and the request receipt. Available to the partner owner and authorized team members within their signed, directly credited operating companies.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The feedback issue ID from GET /feedback or the create response."},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Choose a unique key for this intended action. Retry the same method, path, query and body with the original key. Replays return an operation receipt."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","const":"email","default":"email"}},"additionalProperties":false},"example":{"channel":"email"}}}},"responses":{"200":{"description":"Existing delivery or replay receipt. An identical replay receives a receipt. Check its http_status and result, then retrieve the resource. A processing or reconcile receipt returns 202.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"feedback_id":{"type":["string","null"]},"kind":{"type":"string","enum":["coaching","payee_setup"]},"status":{"type":"string","enum":["sending","sent","reconcile","failed"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","company_id","feedback_id","kind","status","created_at","updated_at"]},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["complete","processing","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"example":{"id":"delivery_demo","company_id":"org_demo","feedback_id":"fb_demo","kind":"coaching","status":"sent","created_at":"2031-04-09T18:07:00Z","updated_at":"2031-04-09T18:07:01Z"}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"201":{"description":"Message submitted.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"feedback_id":{"type":["string","null"]},"kind":{"type":"string","enum":["coaching","payee_setup"]},"status":{"type":"string","enum":["sending","sent","reconcile","failed"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","company_id","feedback_id","kind","status","created_at","updated_at"]},"example":{"id":"delivery_demo","company_id":"org_demo","feedback_id":"fb_demo","kind":"coaching","status":"sent","created_at":"2031-04-09T18:07:00Z","updated_at":"2031-04-09T18:07:01Z"}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Submission is uncertain and needs reconciliation. An identical replay receives a receipt. Check its http_status and result, then retrieve the resource. A processing or reconcile receipt returns 202.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"feedback_id":{"type":["string","null"]},"kind":{"type":"string","enum":["coaching","payee_setup"]},"status":{"type":"string","enum":["sending","sent","reconcile","failed"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","company_id","feedback_id","kind","status","created_at","updated_at"]},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["complete","processing","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"example":{"id":"delivery_demo","company_id":"org_demo","feedback_id":"fb_demo","kind":"coaching","status":"reconcile","created_at":"2031-04-09T18:07:00Z","updated_at":"2031-04-09T18:07:01Z"}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"This partner grant cannot access the workspace.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"No verified recipient is available, a recent or unresolved delivery exists, or the key belongs to a different request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"delivery_pending_or_recent"}}}},"413":{"description":"The request body exceeds the permitted size.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"request_too_large"}}}},"422":{"description":"The requested message cannot be sent.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"message_not_allowed"}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Email is temporarily unavailable or the operation requires reconciliation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"mail_unavailable"}}}}}}},"/api/partner/v1/earnings":{"get":{"operationId":"getPartnerEarnings","tags":["Payments"],"summary":"Read the partner’s own earnings","description":"Returns eligible hours and the partner’s fee in USD cents for one Phoenix calendar month. An unknown amount is null. The default partner grouping returns a summary. The company and recorder groupings add a page of contributions and unallocated_cents for the full filtered month. Recorder contributions allocate the partner fee across evidenced minutes. Locked months use the recordings included in the settlement batch, including late acceptances. Available to the authorized partner owner.","parameters":[{"name":"month","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"description":"Defaults to the current month in Phoenix."},{"name":"group_by","in":"query","required":false,"schema":{"type":"string","enum":["partner","company","recorder"],"default":"partner"},"description":"Select the summary, company contributions or recorder allocations."},{"name":"company_id","in":"query","required":false,"schema":{"type":"string"},"description":"A company registration ID or its operating company ID. Returned company_id values are operating company IDs."},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Return the next page using the previous next_cursor with the same filters. A null next_cursor ends the list."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Maximum rows per page."}],"responses":{"200":{"description":"Earnings summary or grouped contributions.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"month":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"currency":{"type":"string","const":"USD"},"status":{"type":"string","enum":["counting","accruing","locked","held","sending","sent","paid"]},"due_on":{"type":["string","null"],"format":"date"},"paid_on":{"type":["string","null"],"format":"date"},"eligible_hours":{"type":"number"},"amount_cents":{"type":["integer","null"]}},"required":["month","currency","status","due_on","paid_on","eligible_hours","amount_cents"]},{"type":"object","properties":{"month":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"currency":{"type":"string","const":"USD"},"status":{"type":"string","enum":["counting","accruing","locked","held","sending","sent","paid"]},"due_on":{"type":["string","null"],"format":"date"},"paid_on":{"type":["string","null"],"format":"date"},"eligible_hours":{"type":"number"},"amount_cents":{"type":["integer","null"]},"items":{"type":"array","items":{"type":"object","properties":{"company_id":{"type":"string"},"eligible_hours":{"type":"number"},"amount_cents":{"type":["integer","null"]},"held":{"type":"boolean"}},"required":["company_id","eligible_hours","amount_cents","held"]}},"next_cursor":{"type":["string","null"]},"unallocated_cents":{"type":["integer","null"]}},"required":["month","currency","status","due_on","paid_on","eligible_hours","amount_cents","items","next_cursor","unallocated_cents"]},{"type":"object","properties":{"month":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"currency":{"type":"string","const":"USD"},"status":{"type":"string","enum":["counting","accruing","locked","held","sending","sent","paid"]},"due_on":{"type":["string","null"],"format":"date"},"paid_on":{"type":["string","null"],"format":"date"},"eligible_hours":{"type":"number"},"amount_cents":{"type":["integer","null"]},"allocation":{"type":"string","const":"partner_fee_by_confirmed_recorder_minutes"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"recorder_id":{"type":"string"},"eligible_minutes":{"type":"number"},"amount_cents":{"type":"integer"}},"required":["id","company_id","recorder_id","eligible_minutes","amount_cents"]}},"next_cursor":{"type":["string","null"]},"unallocated_cents":{"type":["integer","null"]}},"required":["month","currency","status","due_on","paid_on","eligible_hours","amount_cents","allocation","items","next_cursor","unallocated_cents"]}]},"example":{"month":"2031-04","currency":"USD","status":"counting","due_on":"2031-05-15","paid_on":null,"eligible_hours":0,"amount_cents":0}}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"The partner owner needs an active grant.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}}},"/api/partner/v1/statements":{"get":{"operationId":"listPartnerStatements","tags":["Payments"],"summary":"List monthly statements","description":"Returns the partner’s own statements, newest month first. A referral statement includes payable, held and due_on. Organization share statements use their own settlement status. The month is the statement ID. Available to the authorized partner owner.","parameters":[{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Return the next page using the previous next_cursor with the same filters. A null next_cursor ends the list."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Maximum rows per page."}],"responses":{"200":{"description":"Monthly statement page.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"month":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"status":{"type":"string","enum":["estimated","final","paid"]},"eligible_hours":{"type":"number"},"amount_cents":{"type":["integer","null"]},"currency":{"type":"string","const":"USD"},"paid_on":{"type":["string","null"],"format":"date"},"payable":{"type":"boolean"},"held":{"type":"boolean"},"due_on":{"type":["string","null"],"format":"date"}},"required":["id","month","status","eligible_hours","amount_cents","currency","paid_on","payable","held","due_on"]},{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"month":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"status":{"type":"string","enum":["locked","held","sending","sent","paid"]},"eligible_hours":{"type":"number"},"amount_cents":{"type":["integer","null"]},"currency":{"type":"string","const":"USD"},"paid_on":{"type":["string","null"],"format":"date"}},"required":["id","month","status","eligible_hours","amount_cents","currency","paid_on"]}]}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]},"example":{"items":[{"id":"2031-03","month":"2031-03","status":"final","eligible_hours":0,"amount_cents":0,"currency":"USD","payable":false,"held":false,"due_on":"2031-04-15","paid_on":null}],"next_cursor":null}}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"The partner owner needs an active grant.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}}},"/api/partner/v1/statements/{month}":{"get":{"operationId":"getPartnerStatement","tags":["Payments"],"summary":"Read one monthly statement","description":"Use the statement’s YYYY-MM ID. Retrieve payout lines for transfer and bank deposit progress. Available to the authorized partner owner.","parameters":[{"name":"month","in":"path","required":true,"schema":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"description":"The statement ID in YYYY-MM format."}],"responses":{"200":{"description":"Statement for the requested month.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"month":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"status":{"type":"string","enum":["estimated","final","paid"]},"eligible_hours":{"type":"number"},"amount_cents":{"type":["integer","null"]},"currency":{"type":"string","const":"USD"},"paid_on":{"type":["string","null"],"format":"date"},"payable":{"type":"boolean"},"held":{"type":"boolean"},"due_on":{"type":["string","null"],"format":"date"}},"required":["id","month","status","eligible_hours","amount_cents","currency","paid_on","payable","held","due_on"]},{"type":"object","properties":{"id":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"month":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"status":{"type":"string","enum":["locked","held","sending","sent","paid"]},"eligible_hours":{"type":"number"},"amount_cents":{"type":["integer","null"]},"currency":{"type":"string","const":"USD"},"paid_on":{"type":["string","null"],"format":"date"}},"required":["id","month","status","eligible_hours","amount_cents","currency","paid_on"]}]},"example":{"id":"2031-03","month":"2031-03","status":"final","eligible_hours":0,"amount_cents":0,"currency":"USD","payable":false,"held":false,"due_on":"2031-04-15","paid_on":null}}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"The partner owner needs an active grant.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}}},"/api/partner/v1/payouts":{"get":{"operationId":"listPartnerPayouts","tags":["Payments"],"summary":"List payouts and deposit progress","description":"Lists the partner’s own lines and status for directly credited companies. Monetary fields apply only to the partner’s own lines. Transfer status tracks the movement to the payee. Bank status tracks the deposit separately. A sent transfer can still have a failed deposit. When present, remittance_reference identifies the Colby payout line. Available to the authorized partner owner.","parameters":[{"name":"company_id","in":"query","required":false,"schema":{"type":"string"},"description":"A company registration ID or its operating company ID. Returned company_id values are operating company IDs."},{"name":"month","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"description":"Filter by the payout batch month."},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Return the next page using the previous next_cursor with the same filters. A null next_cursor ends the list."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"description":"Maximum rows per page."}],"responses":{"200":{"description":"Payout lines ordered by ID.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"month":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"status":{"type":"string","enum":["open","sending","sent","paid","failed"]},"sent_at":{"type":["string","null"],"format":"date-time"},"arrival_on":{"type":["string","null"],"format":"date"},"paid_on":{"type":["string","null"],"format":"date"},"due_on":{"type":"string","format":"date"},"held":{"type":"boolean"},"remittance_reference":{"type":["string","null"]},"transfer_status":{"type":"string","enum":["open","sending","sent","failed","reversed"]},"bank_status":{"type":"string","enum":["not_sent","awaiting_deposit","failed","paid"]},"kind":{"const":"company"},"company_id":{"type":"string"}},"required":["id","month","status","sent_at","arrival_on","paid_on","due_on","held","remittance_reference","transfer_status","bank_status","kind","company_id"]},{"type":"object","properties":{"id":{"type":"string"},"month":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"status":{"type":"string","enum":["open","sending","sent","paid","failed"]},"sent_at":{"type":["string","null"],"format":"date-time"},"arrival_on":{"type":["string","null"],"format":"date"},"paid_on":{"type":["string","null"],"format":"date"},"due_on":{"type":"string","format":"date"},"held":{"type":"boolean"},"remittance_reference":{"type":["string","null"]},"transfer_status":{"type":"string","enum":["open","sending","sent","failed","reversed"]},"bank_status":{"type":"string","enum":["not_sent","awaiting_deposit","failed","paid"]},"kind":{"const":"partner"},"company_id":{"type":"null"},"amount_cents":{"type":"integer"},"currency":{"type":"string","const":"USD"}},"required":["id","month","status","sent_at","arrival_on","paid_on","due_on","held","remittance_reference","transfer_status","bank_status","kind","company_id","amount_cents","currency"]}]}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]},"example":{"items":[{"id":"payout_demo","kind":"company","company_id":"org_demo","month":"2031-03","status":"sent","sent_at":"2031-04-10T17:00:00Z","arrival_on":null,"paid_on":null,"due_on":"2031-04-15","held":false,"remittance_reference":"payout_demo","transfer_status":"sent","bank_status":"awaiting_deposit"}],"next_cursor":null}}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"The partner owner needs an active grant.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}}},"/api/partner/v1/payouts/{id}":{"get":{"operationId":"getPartnerPayout","tags":["Payments"],"summary":"Track one payout","description":"Transfer status tracks the movement to the payee. Bank status tracks the deposit separately. A sent transfer can still have a failed deposit. When present, remittance_reference identifies the Colby payout line. The held flag indicates a recorded hold on the line. A company’s bank setup can be checked through its payment-status endpoint. Available to the authorized partner owner.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The payout ID from the list or a payout event."},{"name":"company_id","in":"query","required":false,"schema":{"type":"string"},"description":"A company registration ID or its operating company ID. Returned company_id values are operating company IDs."},{"name":"month","in":"query","required":false,"schema":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"description":"Filter by the payout batch month."}],"responses":{"200":{"description":"Payout line.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"month":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"status":{"type":"string","enum":["open","sending","sent","paid","failed"]},"sent_at":{"type":["string","null"],"format":"date-time"},"arrival_on":{"type":["string","null"],"format":"date"},"paid_on":{"type":["string","null"],"format":"date"},"due_on":{"type":"string","format":"date"},"held":{"type":"boolean"},"remittance_reference":{"type":["string","null"]},"transfer_status":{"type":"string","enum":["open","sending","sent","failed","reversed"]},"bank_status":{"type":"string","enum":["not_sent","awaiting_deposit","failed","paid"]},"kind":{"const":"company"},"company_id":{"type":"string"}},"required":["id","month","status","sent_at","arrival_on","paid_on","due_on","held","remittance_reference","transfer_status","bank_status","kind","company_id"]},{"type":"object","properties":{"id":{"type":"string"},"month":{"type":"string","pattern":"^[0-9]{4}-(0[1-9]|1[0-2])$","example":"2031-04"},"status":{"type":"string","enum":["open","sending","sent","paid","failed"]},"sent_at":{"type":["string","null"],"format":"date-time"},"arrival_on":{"type":["string","null"],"format":"date"},"paid_on":{"type":["string","null"],"format":"date"},"due_on":{"type":"string","format":"date"},"held":{"type":"boolean"},"remittance_reference":{"type":["string","null"]},"transfer_status":{"type":"string","enum":["open","sending","sent","failed","reversed"]},"bank_status":{"type":"string","enum":["not_sent","awaiting_deposit","failed","paid"]},"kind":{"const":"partner"},"company_id":{"type":"null"},"amount_cents":{"type":"integer"},"currency":{"type":"string","const":"USD"}},"required":["id","month","status","sent_at","arrival_on","paid_on","due_on","held","remittance_reference","transfer_status","bank_status","kind","company_id","amount_cents","currency"]}]},"example":{"id":"payout_demo","kind":"company","company_id":"org_demo","month":"2031-03","status":"sent","sent_at":"2031-04-10T17:00:00Z","arrival_on":null,"paid_on":null,"due_on":"2031-04-15","held":false,"remittance_reference":"payout_demo","transfer_status":"sent","bank_status":"awaiting_deposit"}}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"The partner owner needs an active grant.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}}},"/api/partner/v1/companies/{id}/payment-status":{"get":{"operationId":"getCompanyPaymentStatus","tags":["Payments"],"summary":"Check a company’s payout setup","description":"Returns the setup status for a signed, directly credited company. manual indicates that the company follows a separate payment process. Use the returned payee_id for an eligible company setup request. Available to the authorized partner owner.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The company registration ID or operating company ID."}],"responses":{"200":{"description":"Company payout setup status.","content":{"application/json":{"schema":{"type":"object","properties":{"company_id":{"type":"string"},"payee_id":{"type":"string"},"setup_status":{"type":"string","enum":["not_set_up","needs_info","ready","manual"]}},"required":["company_id","payee_id","setup_status"]},"example":{"company_id":"org_demo","payee_id":"org_demo","setup_status":"not_set_up"}}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"The partner owner needs an active grant.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"Resource state or idempotency conflict.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}},"required":["error"]}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}}},"/api/partner/v1/payees/{id}/setup-requests":{"post":{"operationId":"requestPartnerPayeeSetup","tags":["Payments"],"summary":"Request payout setup for an eligible payee","description":"For a company, send an email to its verified owner inviting them to complete secure setup in the portal. The response tracks submission. Omit recipient details. For the authenticated partner’s own payee ID, the response instead contains its hosted setup URL. The literal me path also opens the partner’s own setup. Available to the authorized partner owner.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"Supply the company payee_id from payment-status or the authenticated partner’s own payee ID."},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Choose a unique key for this intended action. Retry the same method, path, query and body with the original key. Replays return an operation receipt."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","const":"email","default":"email"}},"additionalProperties":false},"example":{"channel":"email"}}}},"responses":{"200":{"description":"Hosted setup for the partner’s own payee, an existing company notice, or a completed receipt. An identical replay receives a receipt. Check its http_status and result, then retrieve the resource. A processing or reconcile receipt returns 202.","content":{"application/json":{"schema":{"anyOf":[{"anyOf":[{"type":"object","properties":{"payee_id":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["payee_id","url"]},{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"feedback_id":{"type":["string","null"]},"kind":{"type":"string","enum":["coaching","payee_setup"]},"status":{"type":"string","enum":["sending","sent","reconcile","failed"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","company_id","feedback_id","kind","status","created_at","updated_at"]}]},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["complete","processing","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"example":{"payee_id":"partner_demo","url":"https://example.invalid/payee-setup"}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"201":{"description":"Company owner setup notice submitted.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"feedback_id":{"type":["string","null"]},"kind":{"type":"string","enum":["coaching","payee_setup"]},"status":{"type":"string","enum":["sending","sent","reconcile","failed"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","company_id","feedback_id","kind","status","created_at","updated_at"]},"example":{"id":"delivery_payee_demo","company_id":"org_demo","feedback_id":null,"kind":"payee_setup","status":"sent","created_at":"2031-04-09T18:07:00Z","updated_at":"2031-04-09T18:07:01Z"}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Company setup notice is awaiting reconciliation. An identical replay receives a receipt. Check its http_status and result, then retrieve the resource. A processing or reconcile receipt returns 202.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"company_id":{"type":"string"},"feedback_id":{"type":["string","null"]},"kind":{"type":"string","enum":["coaching","payee_setup"]},"status":{"type":"string","enum":["sending","sent","reconcile","failed"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","company_id","feedback_id","kind","status","created_at","updated_at"]},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["complete","processing","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"example":{"id":"delivery_payee_demo","company_id":"org_demo","feedback_id":null,"kind":"payee_setup","status":"reconcile","created_at":"2031-04-09T18:07:00Z","updated_at":"2031-04-09T18:07:01Z"}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"The partner owner needs an active grant.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"The company is ready or uses manual payments, a recipient is unavailable, a delivery is recent or unresolved, or the request key conflicts.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"already_set_up"}}}},"413":{"description":"The request body exceeds the permitted size.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"request_too_large"}}}},"422":{"description":"The requested message cannot be sent.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"message_not_allowed"}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Email is temporarily unavailable or the operation requires reconciliation.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"mail_unavailable"}}}}}}},"/api/partner/v1/payees/me/setup-requests":{"post":{"operationId":"openOwnPayoutSetup","tags":["Payments"],"summary":"Open the partner owner’s hosted payout setup","description":"Use the hosted URL to complete or update the authenticated partner owner’s own payout details. Keep the URL private. Retain it from the original response because a replay returns a receipt. Available to the authorized partner owner.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"description":"Choose a unique key for this intended action. Retry the same method, path, query and body with the original key. Replays return an operation receipt."}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}},"example":{}}}},"responses":{"200":{"description":"Hosted payout setup for this payee. An identical replay receives a receipt. Check its http_status and result, then retrieve the resource. A processing or reconcile receipt returns 202.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"payee_id":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["payee_id","url"]},{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["complete","processing","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]}]},"example":{"payee_id":"partner_demo","url":"https://example.invalid/payee-setup"}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"202":{"description":"Replay of a processing or uncertain operation. Poll its request receipt.","content":{"application/json":{"schema":{"type":"object","properties":{"request_id":{"type":"string"},"state":{"type":"string","enum":["complete","processing","reconcile"]},"http_status":{"type":["integer","null"]},"result":{"type":["object","null"],"additionalProperties":{"type":"string"}}},"required":["request_id","state","http_status","result"]},"example":{"request_id":"req_demo","state":"processing","http_status":null,"result":null}}},"headers":{"X-Request-Id":{"schema":{"type":"string"},"description":"Poll GET /api/partner/v1/requests/{request_id} using the same connection."}}},"400":{"description":"Invalid input. On writes, check the JSON object and Idempotency-Key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"invalid_input"}}}},"401":{"description":"Use a valid access token for this resource and the partner.lifecycle scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"unauthorized"}}}},"403":{"description":"The partner owner needs an active grant.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"no_access"}}}},"404":{"description":"The requested resource, company or month could not be found within the caller’s scope.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"not_found"}}}},"409":{"description":"This Idempotency-Key belongs to a different request.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"idempotency_key_conflict"}}}},"413":{"description":"The request body exceeds the permitted size.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"request_too_large"}}}},"429":{"description":"The grant has reached its request limit.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"too_many_requests"}}}},"503":{"description":"Service temporarily unavailable. For writes, retain the original key and inspect the receipt before retrying.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"detail":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"},"id":{"type":"string"}},"required":["error"]},"example":{"error":"temporarily_unavailable"}}}}}}}},"webhooks":{"partnerEvents":{"post":{"operationId":"receivePartnerEventBatch","summary":"Receive a signed event batch","description":"A customer-hosted HTTPS endpoint. Verify the signature over the original request bytes before decoding JSON. Persist the event sequence before acknowledging.","security":[],"parameters":[{"in":"header","name":"X-Colby-Timestamp","required":true,"schema":{"type":"string","pattern":"^[0-9]+$"}},{"in":"header","name":"X-Colby-Signature","required":true,"schema":{"type":"string","pattern":"^v1=[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subscription_id":{"type":"string"},"events":{"type":"array","items":{"type":"object","properties":{"seq":{"type":"integer","minimum":0},"event_type":{"type":"string"},"resource_id":{"type":"string"},"org_id":{"type":["string","null"]},"state":{"type":["string","null"]},"observed_at":{"type":"string","format":"date-time"}},"required":["seq","event_type","resource_id","org_id","state","observed_at"]}},"next_cursor":{"type":"integer","minimum":0},"has_more":{"type":"boolean"}},"required":["subscription_id","events","next_cursor","has_more"]}}}},"responses":{"2XX":{"description":"Batch accepted by your receiver."}}}}}}