PATCHpartial

Act on a representative appointment

Controlled by PEOPLES_COURT_API_CANONICAL_ROUTES. The shared operation rechecks current authority and pinned Rules. Partner writes require representatives:manage and are confined to the membership side. Existing grants gain no authority. Invitation replay returns invitationEmail: not_repeated without sending another email.

/api/cases/{id}/representativesupdateRepresentativePreview

Authentication and authority

Use one listed account-session, scoped OAuth, or partner credential alternative. Account tokens retain the approving account’s authority. Cookie-authenticated writes require same-origin authorization. Alternatives are OR; schemes in one alternative are AND.

CanonicalSession

CanonicalPartnerBearer

AccountOAuth

Account tokens authorize only their approving account and case scope. S256 PKCE is mandatory on the code flow. Explicit reacceptance is required after Rules/disclosure changes.

Parameters

NameLocationRequirementSchema
idpathRequired{"type":"string"}
Idempotency-Key

Reuse across compatibility and canonical aliases to recover the same committed act. Changed typed input conflicts.

headerOptional{"type":"string"}

Request body

Required request body.

application/json

{
  "$ref": "#/components/schemas/RepresentativeChangePreview",
  "type": "object",
  "required": [
    "grantId",
    "action"
  ],
  "properties": {
    "grantId": {
      "type": "string"
    },
    "action": {
      "type": "string",
      "enum": [
        "accept",
        "revoke",
        "withdraw"
      ]
    },
    "professionalStatus": {
      "type": "string",
      "enum": [
        "licensed_lawyer",
        "not_lawyer"
      ]
    },
    "licenseJurisdictions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "description": "Partner membership authority permits only own-side revocation. Acceptance and withdrawal require the representative account."
}

Responses

200

Authorized operation result.

application/json

{
  "$ref": "#/components/schemas/CanonicalUpdateRepresentativePreviewResponse",
  "type": "object",
  "properties": {
    "data": {
      "$ref": "#/components/schemas/CanonicalRepresentativeResult",
      "type": "object",
      "properties": {
        "grant": {
          "$ref": "#/components/schemas/CanonicalRepresentative",
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "party": {
              "type": "string",
              "enum": [
                "claimant",
                "respondent"
              ]
            },
            "representativeEmail": {
              "type": "string"
            },
            "basisOfAuthority": {
              "type": "string"
            },
            "scopes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "status": {
              "type": "string"
            },
            "createdAt": {
              "type": "string"
            },
            "acceptedAt": {
              "type": "string"
            },
            "revokedAt": {
              "type": "string"
            },
            "expiresAt": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "party",
            "representativeEmail",
            "basisOfAuthority",
            "scopes",
            "status",
            "createdAt"
          ]
        },
        "invitationEmail": {
          "type": "string",
          "enum": [
            "sent",
            "not_configured",
            "failed",
            "not_repeated"
          ]
        }
      },
      "required": [
        "grant"
      ]
    },
    "requestId": {
      "type": "string"
    }
  },
  "required": [
    "data",
    "requestId"
  ],
  "x-code-source": "lib/proceeding/representatives.ts"
}
404

Preview disabled or authorized resource unavailable.

default

RFC 9457 style problem response.

application/problem+json

{
  "$ref": "#/components/schemas/Problem",
  "type": "object",
  "required": [
    "type",
    "title",
    "status",
    "code",
    "detail",
    "requestId"
  ],
  "properties": {
    "type": {
      "type": "string",
      "format": "uri"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer"
    },
    "code": {
      "type": "string"
    },
    "detail": {
      "type": "string"
    },
    "requestId": {
      "type": "string"
    }
  }
}

Example response

Successful response

{
  "data": {
    "grant": {
      "id": "id_test",
      "party": "claimant",
      "representativeEmail": "representativeEmail_test",
      "basisOfAuthority": "basisOfAuthority_test",
      "scopes": [
        "scopes_test"
      ],
      "status": "status_test",
      "createdAt": "createdAt_test"
    }
  },
  "requestId": "requestId_test"
}

Errors

Read the response status and stable error code. See errors and rate limits for recovery. Refresh the resource before resolving a state or digest conflict.

Idempotency and retries

  • For throttling, honor Retry-After when present. Back off on retryable server failures.
  • Send a unique Idempotency-Key. An exact retry returns the stored result; reusing the key with a different request fails.
  • The request is accepted only when its credential, authority, case state, and resource preconditions are satisfied.