Overview
Mirrors a partner tenant and user into PatchOps. The operation is idempotent on partner_tenant_id and partner_user_id, and reactivates a previously revoked user in the same partner scope.
Auth
Partner-admin bearer token with provision scope
Surface
Users & Tenants
Base URL
https://patchops.ai
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| Authorization | header | Bearer token | yes | Partner-admin API token issued to the partner backend.example: Bearer po_part_... |
Request Body
Request example
application/json
{
"partner_tenant_id": "acme-west",
"partner_user_id": "operator-123",
"email": "operator@acme.example",
"name": "Taylor Operator",
"role": "member"
}Notes
- The bearer_token is returned once. The partner backend must store it for the user.
- Tokens with provision scope cannot grant owner/admin roles unless they also have manage_admins.
Responses
| Status | Meaning |
|---|---|
| 200 | User and tenant were created, found, or reactivated. |
| 400 | Payload validation failed. |
| 409 | Email or idempotency mismatch conflict. |
| 413 | Request body exceeded the 4 KB limit. |
| 401 | Missing, malformed, expired, revoked, or invalid bearer token. |
| 403 | Partner is inactive or the bearer token lacks the required scope. |
| 500 | Provisioning failed. |
cURL
POST /api/partner-admin/users
Terminal
curl "$BASE_URL/api/partner-admin/users" \
-X POST \
-H "Authorization: Bearer $PARTNER_ADMIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"partner_tenant_id": "acme-west",
"partner_user_id": "operator-123",
"email": "operator@acme.example",
"name": "Taylor Operator",
"role": "member"
}'Sample Response
Response example
JSON
{
"patchops_org_id": "org_...",
"patchops_user_id": "usr_...",
"mcp_url": "https://patchops.ai/api/mcp/...",
"bearer_token": "po_user_...",
"bearer_token_prefix": "po_user_",
"has_bearer_token": true,
"created_org": false,
"created_user": true
}