{"openapi":"3.1.0","info":{"title":"PeopleIQ Partner API","version":"1.0.0","description":"Manage your PeopleIQ customer tenants: create live or sandbox customers, provision users, change product subscriptions, request product API credentials and read wholesale statements. Errors use `{ error: { code, message, requestId } }`; writes accept an `Idempotency-Key` header; rate limits are per client (X-RateLimit-* headers)."},"servers":[{"url":"/"}],"tags":[{"name":"Meta"},{"name":"Auth"},{"name":"Billing"},{"name":"Tenants"},{"name":"Users"},{"name":"Subscriptions"},{"name":"Credentials"}],"paths":{"/partner/v1/openapi.json":{"get":{"operationId":"getOpenApi","tags":["Meta"],"summary":"This OpenAPI 3.1 document","security":[],"responses":{"200":{"description":"OpenAPI document","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/partner/v1/oauth/token":{"post":{"operationId":"createToken","tags":["Auth"],"summary":"OAuth2 client-credentials token","description":"grant_type=client_credentials with client_id/client_secret in the body (JSON or form) or HTTP Basic. Optional space-separated `scope` (a subset of the client's scopes). Returns a Bearer access token valid for 1 hour.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}}},"security":[],"responses":{"200":{"description":"Access token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/v1/me":{"get":{"operationId":"getMe","tags":["Meta"],"summary":"The calling partner and credential","security":[{"oauth2":[]}],"responses":{"200":{"description":"Caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/v1/pricing":{"get":{"operationId":"getWholesalePricing","tags":["Billing"],"summary":"Your wholesale price list (per seat per month)","security":[{"oauth2":["statements:read"]}],"x-required-scope":"statements:read","responses":{"200":{"description":"Wholesale prices","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/v1/tenants":{"get":{"operationId":"listTenants","tags":["Tenants"],"summary":"List your customer tenants","parameters":[{"name":"limit","in":"query","required":false,"description":"Page size 1–100 (default 25)","schema":{"type":"integer"}},{"name":"cursor","in":"query","required":false,"description":"nextCursor from the previous page","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Search name / id","schema":{"type":"string"}},{"name":"sandbox","in":"query","required":false,"description":"Only sandbox (true) or only live (false) customers","schema":{"type":"boolean"}}],"security":[{"oauth2":["tenants:read"]}],"x-required-scope":"tenants:read","responses":{"200":{"description":"Page of tenants","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantList"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createTenant","tags":["Tenants"],"summary":"Create a customer tenant (live or sandbox)","description":"Creates the tenant, its product subscriptions (billed to you at wholesale; sandbox = free, expires after 30 days) and its first admin user. A temporary password is returned once when none is supplied.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Replay-safe retries (24h)","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenant"}}}},"security":[{"oauth2":["tenants:write"]}],"x-required-scope":"tenants:write","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedTenant"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Idempotency key reused with a different body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/v1/tenants/{id}":{"get":{"operationId":"getTenant","tags":["Tenants"],"summary":"Get a customer tenant","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"oauth2":["tenants:read"]}],"x-required-scope":"tenants:read","responses":{"200":{"description":"Tenant","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or not managed by you)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"operationId":"updateTenant","tags":["Tenants"],"summary":"Rename, suspend or reactivate a customer tenant","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Replay-safe retries (24h)","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchTenant"}}}},"security":[{"oauth2":["tenants:write"]}],"x-required-scope":"tenants:write","responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or not managed by you)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Idempotency key reused with a different body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/v1/tenants/{id}/users":{"get":{"operationId":"listTenantUsers","tags":["Users"],"summary":"List a customer's users","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"oauth2":["users:read"]}],"x-required-scope":"users:read","responses":{"200":{"description":"Users","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserList"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or not managed by you)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createTenantUser","tags":["Users"],"summary":"Provision a customer user","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Replay-safe retries (24h)","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateUser"}}}},"security":[{"oauth2":["users:write"]}],"x-required-scope":"users:write","responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatedUser"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or not managed by you)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Idempotency key reused with a different body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/v1/tenants/{id}/users/{userId}":{"patch":{"operationId":"updateTenantUser","tags":["Users"],"summary":"Disable / enable a customer user or change role / product access","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"userId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Replay-safe retries (24h)","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchUser"}}}},"security":[{"oauth2":["users:write"]}],"x-required-scope":"users:write","responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or not managed by you)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Idempotency key reused with a different body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/v1/tenants/{id}/subscriptions":{"get":{"operationId":"listTenantSubscriptions","tags":["Subscriptions"],"summary":"A customer's product subscriptions","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"oauth2":["tenants:read"]}],"x-required-scope":"tenants:read","responses":{"200":{"description":"Subscriptions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionList"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or not managed by you)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/v1/tenants/{id}/subscriptions/{product}":{"put":{"operationId":"putTenantSubscription","tags":["Subscriptions"],"summary":"Add or change a customer's product subscription","description":"Creates the subscription when absent (the customer's admins get access to the product). status=canceled makes the product read-only for the customer.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"product","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Replay-safe retries (24h)","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutSubscription"}}}},"security":[{"oauth2":["subscriptions:write"]}],"x-required-scope":"subscriptions:write","responses":{"200":{"description":"Subscription","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Subscription"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or not managed by you)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Idempotency key reused with a different body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"operationId":"deleteTenantSubscription","tags":["Subscriptions"],"summary":"Remove a product from a customer","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"product","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Replay-safe retries (24h)","schema":{"type":"string","minLength":8,"maxLength":200}}],"security":[{"oauth2":["subscriptions:write"]}],"x-required-scope":"subscriptions:write","responses":{"200":{"description":"Tenant after removal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tenant"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or not managed by you)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Idempotency key reused with a different body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/v1/tenants/{id}/credentials":{"post":{"operationId":"requestProductCredentials","tags":["Credentials"],"summary":"Request product API credentials for a customer","description":"Sends a signed `credentials.requested` event to the product (HR or Recruiter), which mints an API key (or, for HR, an OAuth client: `kind: oauth_client`) with the requested scopes and returns it over a signed server-to-server response. The platform stores the secret encrypted. Status `ready` ⇒ fetch the secret ONCE with `POST /partner/v1/tenants/{id}/credentials/{requestId}/secret`; `awaiting_product` ⇒ the product was unreachable, delivery is retried automatically (poll the request); `failed` ⇒ the product refused (see `lastError`). The secret is never part of this response (nor of idempotent replays).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Replay-safe retries (24h)","schema":{"type":"string","minLength":8,"maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialRequestInput"}}}},"security":[{"oauth2":["credentials:write"]}],"x-required-scope":"credentials:write","responses":{"202":{"description":"Request recorded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialRequest"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or not managed by you)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Idempotency key reused with a different body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"operationId":"listProductCredentialRequests","tags":["Credentials"],"summary":"Credential requests for a customer","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"oauth2":["credentials:write"]}],"x-required-scope":"credentials:write","responses":{"200":{"description":"Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialRequestList"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or not managed by you)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/v1/tenants/{id}/credentials/{requestId}":{"get":{"operationId":"getProductCredentialRequest","tags":["Credentials"],"summary":"One credential request (status; no secret)","description":"Retries delivery to the product first when the request is still `awaiting_product`.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"requestId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"oauth2":["credentials:write"]}],"x-required-scope":"credentials:write","responses":{"200":{"description":"Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialRequest"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or not managed by you)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/v1/tenants/{id}/credentials/{requestId}/secret":{"post":{"operationId":"retrieveProductCredentialSecret","tags":["Credentials"],"summary":"Retrieve the issued secret (exactly once)","description":"Returns the product credential's secret once and wipes it from the platform. A second call is 410 `secret_already_retrieved`; 409 `credential_pending` / `credential_failed` when nothing was issued. Not idempotent-replayable by design (the secret is never stored in the replay cache).","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"requestId","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"oauth2":["credentials:write"]}],"x-required-scope":"credentials:write","responses":{"200":{"description":"The credential with its secret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CredentialSecret"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found (or not managed by you)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/v1/statements/{period}":{"get":{"operationId":"getStatement","tags":["Billing"],"summary":"Monthly partner statement (YYYY-MM)","description":"The generated statement for the period, or — when none has been generated yet — a live preview (status `preview`, not persisted).","parameters":[{"name":"period","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"oauth2":["statements:read"]}],"x-required-scope":"statements:read","responses":{"200":{"description":"Statement","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Statement"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/partner/v1/statements/{period}/export":{"get":{"operationId":"exportStatement","tags":["Billing"],"summary":"Statement as CSV","parameters":[{"name":"period","in":"path","required":true,"schema":{"type":"string"}}],"security":[{"oauth2":["statements:read"]}],"x-required-scope":"statements:read","responses":{"200":{"description":"CSV","content":{"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing / invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden (scope / sandbox-only)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"requestId":{"type":"string"}}}}},"TokenRequest":{"type":"object","required":["grant_type"],"properties":{"grant_type":{"const":"client_credentials"},"client_id":{"type":"string"},"client_secret":{"type":"string"},"scope":{"type":"string","description":"Space-separated subset of the client's scopes"}}},"TokenResponse":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"const":"Bearer"},"expires_in":{"type":"integer"},"scope":{"type":"string"}}},"Me":{"type":"object","properties":{"partner":{"type":"object"},"client":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"sandboxOnly":{"type":"boolean"},"rateLimitPerMin":{"type":"integer"}}},"scopes":{"type":"array","items":{"type":"string"}}}},"Subscription":{"type":"object","properties":{"product":{"enum":["recruiter","hr"]},"owned":{"type":"boolean"},"plan":{"enum":["starter","pro","enterprise",null]},"status":{"enum":["trialing","active","past_due","canceled",null]},"seats":{"type":["integer","null"]},"features":{"type":"array","items":{"type":"string"}},"readOnly":{"type":"boolean"}}},"SubscriptionList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Subscription"}}}},"Tenant":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"enum":["active","suspended"]},"sandbox":{"type":"boolean"},"sandboxExpiresAt":{"type":["string","null"],"format":"date-time"},"partnerAccessConsent":{"type":"boolean"},"billingEmail":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"subscriptions":{"type":"array","items":{"type":"object","properties":{"product":{"enum":["recruiter","hr"]},"plan":{"enum":["starter","pro","enterprise"]},"status":{"enum":["trialing","active","past_due","canceled"]},"seats":{"type":"integer"}}}},"products":{"type":"array","items":{"type":"object"}},"userCount":{"type":"integer"}}},"TenantList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Tenant"}},"nextCursor":{"type":["string","null"]},"total":{"type":"integer"}}},"CreateTenant":{"type":"object","required":["name","products","adminEmail"],"properties":{"name":{"type":"string","maxLength":100},"products":{"type":"array","minItems":1,"items":{"type":"object","required":["product"],"properties":{"product":{"enum":["recruiter","hr"]},"plan":{"enum":["starter","pro","enterprise"],"default":"starter"},"seats":{"type":"integer","minimum":1,"default":1}}}},"sandbox":{"type":"boolean","default":false,"description":"Free sandbox; expires and is purged after 30 days"},"partnerAccessConsent":{"type":"boolean","default":false,"description":"Set true only with the customer's documented consent to partner support access"},"adminEmail":{"type":"string","format":"email"},"adminName":{"type":"string"},"adminPassword":{"type":"string","minLength":10,"description":"Omit to receive a one-time temporary password"},"billingEmail":{"type":"string","format":"email"}}},"CreatedTenant":{"type":"object","properties":{"tenant":{"$ref":"#/components/schemas/Tenant"},"admin":{"$ref":"#/components/schemas/User"},"temporaryPassword":{"type":"string"},"provisioning":{"type":"object"}}},"PatchTenant":{"type":"object","properties":{"name":{"type":"string"},"status":{"enum":["active","suspended"]}}},"User":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"role":{"enum":["member","admin"]},"productAccess":{"type":"array","items":{"enum":["recruiter","hr"]}},"disabled":{"type":"boolean"},"createdAt":{"type":"string"}}},"UserList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/User"}},"nextCursor":{"type":["string","null"]},"total":{"type":"integer"}}},"CreateUser":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"},"name":{"type":"string"},"role":{"enum":["member","admin"],"default":"member"},"productAccess":{"type":"array","items":{"enum":["recruiter","hr"]}},"password":{"type":"string","minLength":10}}},"CreatedUser":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"temporaryPassword":{"type":"string"},"provisioning":{"type":"object"}}},"PatchUser":{"type":"object","properties":{"disabled":{"type":"boolean"},"role":{"enum":["member","admin"]},"productAccess":{"type":"array","items":{"enum":["recruiter","hr"]}}}},"PutSubscription":{"type":"object","properties":{"plan":{"enum":["starter","pro","enterprise"]},"seats":{"type":"integer","minimum":1,"maximum":100000},"status":{"enum":["active","canceled"]}}},"CredentialRequestInput":{"type":"object","required":["product"],"properties":{"product":{"enum":["recruiter","hr"]},"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"kind":{"enum":["api_key","oauth_client"],"description":"Default api_key; oauth_client is HR only"}}},"CredentialSecret":{"type":"object","properties":{"id":{"type":"string"},"product":{"type":"string"},"tenantId":{"type":"string"},"kind":{"enum":["api_key","oauth_client"]},"credential":{"type":"object","properties":{"id":{"type":"string"},"prefix":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}},"secret":{"type":"string"}}},"note":{"type":"string"}}},"CredentialRequest":{"type":"object","properties":{"id":{"type":"string"},"product":{"type":"string"},"tenantId":{"type":"string"},"name":{"type":"string"},"kind":{"enum":["api_key","oauth_client"]},"scopes":{"type":"array","items":{"type":"string"}},"status":{"enum":["awaiting_product","ready","retrieved","failed"]},"delivered":{"type":"boolean"},"eventId":{"type":"string"},"credential":{"type":["object","null"],"properties":{"id":{"type":"string"},"prefix":{"type":["string","null"]},"scopes":{"type":"array","items":{"type":"string"}}}},"secretAvailable":{"type":"boolean"},"deliveredAt":{"type":["string","null"]},"retrievedAt":{"type":["string","null"]},"lastError":{"type":["string","null"]},"note":{"type":"string"}}},"CredentialRequestList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CredentialRequest"}}}},"StatementLine":{"type":"object","properties":{"tenantId":{"type":"string"},"tenantName":{"type":"string"},"product":{"type":"string"},"plan":{"type":"string"},"seats":{"type":"integer"},"status":{"type":"string"},"listUnitMinor":{"type":"integer"},"wholesaleUnitMinor":{"type":"integer"},"discountPct":{"type":"integer"},"amountMinor":{"type":"integer"}}},"Statement":{"type":"object","properties":{"id":{"type":"string"},"period":{"type":"string"},"currency":{"enum":["USD","INR"]},"status":{"enum":["preview","draft","issued"]},"lines":{"type":"array","items":{"$ref":"#/components/schemas/StatementLine"}},"seatsTotal":{"type":"integer"},"apiCalls":{"type":"integer"},"productApiUsage":{"type":["object","null"],"description":"Customers' RecruiterIQ / HRIQ /v1 calls in the period (informational)","properties":{"products":{"type":"object"},"byTenant":{"type":"object"}}},"totalMinor":{"type":"integer"},"invoiceId":{"type":["string","null"]}}},"PriceList":{"type":"object","properties":{"currency":{"type":"string"},"products":{"type":"array","items":{"type":"object"}}}}},"securitySchemes":{"oauth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/partner/v1/oauth/token","scopes":{"tenants:read":"List and read managed customer tenants","tenants:write":"Create, rename, suspend and reactivate customer tenants","users:read":"List customer users","users:write":"Create and update customer users","subscriptions:write":"Add, change and remove customer product subscriptions","credentials:write":"Request product API credentials for a customer","statements:read":"Read partner statements"}}}}}}}