> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paywise.de/llms.txt
> Use this file to discover all available pages before exploring further.

# Revoke an active company membership

> The memberships of one managed company: list, add, and revoke users.



## OpenAPI

````yaml /api-docs/partner-api/openapi.json post /partner/v2/companies/{company_id}/users/{membership_id}/revoke/
openapi: 3.0.3
info:
  description: >-
    Onboard and manage companies and their memberships through the current API
    at the `/partner/v2/` HTTP path.
  title: paywise Partner API
  version: current
servers:
  - description: Production environment
    url: https://api.paywise.de
  - description: Sandbox environment
    url: https://api-sandbox.paywise.de
security: []
tags:
  - description: Client companies managed by the partner.
    name: Companies
  - description: Memberships and invitations of a managed company.
    name: Company users
  - description: Webhook endpoints and their signing secrets.
    name: Webhooks
  - description: Delivery log and redelivery of webhook events.
    name: Webhook deliveries
  - description: Ordered feed of the events webhooks deliver.
    name: Events
  - description: Reference catalog of legal forms.
    name: Legal forms
  - description: The authenticated credential and API availability.
    name: Meta
  - description: Rate-limit headroom of the credential.
    name: Usage
externalDocs:
  url: https://docs.paywise.de/api-docs/partner-api/introduction
paths:
  /partner/v2/companies/{company_id}/users/{membership_id}/revoke/:
    post:
      tags:
        - Company users
      summary: Revoke an active company membership
      description: 'The memberships of one managed company: list, add, and revoke users.'
      operationId: revoke-an-active-company-membership
      parameters:
        - description: >-
            Required client-supplied key scoped to the Partner owner, method,
            operation and path. An exact retry replays the original response
            while it is retained, including after credential rotation or
            replacement. Current permissions are required.
          in: header
          name: Idempotency-Key
          required: true
          schema:
            type: string
        - description: UUID of the managed company in this request.
          in: path
          name: company_id
          required: true
          schema:
            format: uuid
            type: string
        - description: UUID of the company membership in this request.
          in: path
          name: membership_id
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MembershipRevocationRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Membership'
          description: ''
          headers:
            Cache-Control:
              description: >-
                Cacheability directive. Authenticated responses use `private,
                no-store`; the legal-form catalog may use `private,
                max-age=86400`.
              schema:
                type: string
            X-Paywise-Environment:
              description: Environment that produced the response.
              schema:
                enum:
                  - production
                  - sandbox
                type: string
            X-Paywise-Request-Id:
              description: >-
                Fresh server-assigned correlation id for this response.
                Caller-provided request ids are ignored.
              schema:
                format: uuid
                type: string
        '400':
          content:
            application/json:
              examples:
                validation-error:
                  value:
                    code: validation_error
                    detail: The request contains invalid data.
                    errors:
                      - code: invalid
                        field: users[0].email
                        message: Enter a valid email address.
              schema:
                $ref: '#/components/schemas/Error'
          description: ''
          headers:
            Cache-Control:
              description: >-
                Cacheability directive. Authenticated responses use `private,
                no-store`; the legal-form catalog may use `private,
                max-age=86400`.
              schema:
                type: string
            X-Paywise-Environment:
              description: Environment that produced the response.
              schema:
                enum:
                  - production
                  - sandbox
                type: string
            X-Paywise-Request-Id:
              description: >-
                Fresh server-assigned correlation id for this response.
                Caller-provided request ids are ignored.
              schema:
                format: uuid
                type: string
        '401':
          content:
            application/json:
              examples:
                authentication-error:
                  value:
                    code: not_authenticated
                    detail: Authentication credentials were not provided.
              schema:
                $ref: '#/components/schemas/Error'
          description: Standard error response.
          headers:
            Cache-Control:
              description: >-
                Cacheability directive. Authenticated responses use `private,
                no-store`; the legal-form catalog may use `private,
                max-age=86400`.
              schema:
                type: string
            X-Paywise-Environment:
              description: Environment that produced the response.
              schema:
                enum:
                  - production
                  - sandbox
                type: string
            X-Paywise-Request-Id:
              description: >-
                Fresh server-assigned correlation id for this response.
                Caller-provided request ids are ignored.
              schema:
                format: uuid
                type: string
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: ''
          headers:
            Cache-Control:
              description: >-
                Cacheability directive. Authenticated responses use `private,
                no-store`; the legal-form catalog may use `private,
                max-age=86400`.
              schema:
                type: string
            X-Paywise-Environment:
              description: Environment that produced the response.
              schema:
                enum:
                  - production
                  - sandbox
                type: string
            X-Paywise-Request-Id:
              description: >-
                Fresh server-assigned correlation id for this response.
                Caller-provided request ids are ignored.
              schema:
                format: uuid
                type: string
        '404':
          content:
            application/json:
              examples:
                not-found-error:
                  value:
                    code: not_found
                    detail: The requested resource was not found.
              schema:
                $ref: '#/components/schemas/Error'
          description: Standard error response.
          headers:
            Cache-Control:
              description: >-
                Cacheability directive. Authenticated responses use `private,
                no-store`; the legal-form catalog may use `private,
                max-age=86400`.
              schema:
                type: string
            X-Paywise-Environment:
              description: Environment that produced the response.
              schema:
                enum:
                  - production
                  - sandbox
                type: string
            X-Paywise-Request-Id:
              description: >-
                Fresh server-assigned correlation id for this response.
                Caller-provided request ids are ignored.
              schema:
                format: uuid
                type: string
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MembershipResponsibilityResolutionError'
          description: Standard error response.
          headers:
            Cache-Control:
              description: >-
                Cacheability directive. Authenticated responses use `private,
                no-store`; the legal-form catalog may use `private,
                max-age=86400`.
              schema:
                type: string
            X-Paywise-Environment:
              description: Environment that produced the response.
              schema:
                enum:
                  - production
                  - sandbox
                type: string
            X-Paywise-Request-Id:
              description: >-
                Fresh server-assigned correlation id for this response.
                Caller-provided request ids are ignored.
              schema:
                format: uuid
                type: string
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Standard error response.
          headers:
            Cache-Control:
              description: >-
                Cacheability directive. Authenticated responses use `private,
                no-store`; the legal-form catalog may use `private,
                max-age=86400`.
              schema:
                type: string
            Retry-After:
              description: Integer seconds to wait before retrying a throttled request.
              schema:
                minimum: 1
                type: integer
            X-Paywise-Environment:
              description: Environment that produced the response.
              schema:
                enum:
                  - production
                  - sandbox
                type: string
            X-Paywise-Request-Id:
              description: >-
                Fresh server-assigned correlation id for this response.
                Caller-provided request ids are ignored.
              schema:
                format: uuid
                type: string
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Standard error response.
          headers:
            Cache-Control:
              description: >-
                Cacheability directive. Authenticated responses use `private,
                no-store`; the legal-form catalog may use `private,
                max-age=86400`.
              schema:
                type: string
            X-Paywise-Environment:
              description: Environment that produced the response.
              schema:
                enum:
                  - production
                  - sandbox
                type: string
            X-Paywise-Request-Id:
              description: >-
                Fresh server-assigned correlation id for this response.
                Caller-provided request ids are ignored.
              schema:
                format: uuid
                type: string
      security:
        - partnerBearerAuth: []
components:
  schemas:
    MembershipRevocationRequest:
      description: >-
        Unknown and read-only request fields are rejected with a validation
        error instead of being silently ignored.
      properties:
        reason:
          description: Reason for revoking the membership.
          maxLength: 500
          minLength: 1
          type: string
      required:
        - reason
      type: object
    Membership:
      description: A user's membership in a managed company.
      properties:
        created_at:
          description: Time at which the membership was created.
          format: date-time
          readOnly: true
          type: string
        email:
          description: >-
            Email address submitted with the invitation while it is unaccepted;
            after acceptance, reflects the user's current profile.
          format: email
          maxLength: 128
          type: string
        first_name:
          description: >-
            Given name submitted with the invitation while it is unaccepted;
            after acceptance, reflects the user's current profile.
          maxLength: 128
          type: string
        id:
          description: >-
            Stable identifier of this user's membership in the managed company.
            Use it as membership_id in the company users endpoints.
          format: uuid
          readOnly: true
          type: string
        invite_expires_at:
          description: >-
            Expiry time of the setup invitation while the membership is
            pending_setup; null when no pending setup invitation is attached.
          format: date-time
          nullable: true
          readOnly: true
          type: string
        last_name:
          description: >-
            Family name submitted with the invitation while it is unaccepted;
            after acceptance, reflects the user's current profile.
          maxLength: 128
          type: string
        revocation_reason:
          description: Reason recorded when the membership was revoked.
          readOnly: true
          type: string
        revoked_at:
          description: Time at which the membership was revoked.
          format: date-time
          nullable: true
          readOnly: true
          type: string
        revoked_by_token_id:
          description: Partner credential that revoked the membership, when applicable.
          format: uuid
          nullable: true
          readOnly: true
          type: string
        role:
          allOf:
            - $ref: '#/components/schemas/RoleEnum'
          description: |-
            Permissions the user receives within the managed company.

            * `admin` - admin
            * `tax_consultant` - tax_consultant
            * `member` - member
            * `readonly` - readonly
            * `developer` - developer
        sandbox_origin:
          allOf:
            - $ref: '#/components/schemas/SandboxOriginEnum'
          description: >-
            Provenance of the user behind this membership — `sandbox_native` for
            a subject created inside the sandbox (a test resource),
            `production_mirror` for a read-only copy of a production user,
            `unclassified` otherwise (always so in production).


            * `production_mirror` - Production mirror

            * `sandbox_native` - Sandbox native

            * `unclassified` - Unclassified
          readOnly: true
        status:
          allOf:
            - $ref: '#/components/schemas/StatusEnum'
          description: >-
            Membership lifecycle state: pending_setup awaits invitation
            acceptance; active grants access; cancelled ends a pending
            invitation; revoked removes an active membership's access.
          readOnly: true
        updated_at:
          description: Time at which the membership was last updated.
          format: date-time
          readOnly: true
          type: string
      required:
        - created_at
        - email
        - first_name
        - id
        - invite_expires_at
        - last_name
        - revocation_reason
        - revoked_at
        - revoked_by_token_id
        - role
        - sandbox_origin
        - status
        - updated_at
      type: object
    Error:
      properties:
        code:
          description: Machine-readable error category.
          type: string
        detail:
          description: Short human-readable summary of the error.
          type: string
        errors:
          description: Field-level validation errors, when applicable.
          items:
            $ref: '#/components/schemas/ErrorItem'
          type: array
      required:
        - detail
        - code
      type: object
    MembershipResponsibilityResolutionError:
      properties:
        code:
          description: Machine-readable error category.
          type: string
        detail:
          description: Short human-readable summary of the error.
          type: string
        errors:
          description: Field-level validation errors, when applicable.
          items:
            $ref: '#/components/schemas/ErrorItem'
          type: array
        impact:
          allOf:
            - $ref: '#/components/schemas/MembershipResponsibilityImpact'
          description: >-
            Protected work and eligible replacements that must be resolved
            before revocation.
      required:
        - detail
        - code
      type: object
    RoleEnum:
      description: |-
        * `admin` - admin
        * `tax_consultant` - tax_consultant
        * `member` - member
        * `readonly` - readonly
        * `developer` - developer
      enum:
        - admin
        - tax_consultant
        - member
        - readonly
        - developer
      type: string
    SandboxOriginEnum:
      description: |-
        * `production_mirror` - Production mirror
        * `sandbox_native` - Sandbox native
        * `unclassified` - Unclassified
      enum:
        - production_mirror
        - sandbox_native
        - unclassified
      type: string
    StatusEnum:
      enum:
        - pending_setup
        - active
        - cancelled
        - revoked
      type: string
    ErrorItem:
      properties:
        code:
          description: Machine-readable field error code.
          type: string
        field:
          description: >-
            Path to the field that caused the error, using dots for objects and
            brackets for list indexes, for example `claims[0].amount`; null for
            an error without a field path.
          nullable: true
          type: string
        message:
          description: Human-readable explanation of the field error.
          type: string
      required:
        - field
        - code
        - message
      type: object
    MembershipResponsibilityImpact:
      description: Protected work that must be reassigned before membership revocation.
      properties:
        affected_mandate_count:
          description: Number of protected mandates assigned to this membership.
          minimum: 0
          type: integer
        affected_mandates:
          description: Protected mandates currently assigned to this membership.
          items:
            $ref: '#/components/schemas/MembershipResponsibilityMandate'
          type: array
        eligible_replacements:
          description: Active company users that can take over the protected work.
          items:
            $ref: '#/components/schemas/MembershipResponsibilityReplacement'
          type: array
        pending_order_intent_count:
          description: Number of pending orders assigned to this membership.
          minimum: 0
          type: integer
        pending_order_intents:
          description: >-
            Pending orders whose future mandate responsibility is assigned to
            this membership.
          items:
            $ref: '#/components/schemas/MembershipResponsibilityOrder'
          type: array
        total_affected_count:
          description: Total protected mandates and pending orders to resolve.
          minimum: 0
          type: integer
      required:
        - affected_mandate_count
        - affected_mandates
        - eligible_replacements
        - pending_order_intent_count
        - pending_order_intents
        - total_affected_count
      type: object
    MembershipResponsibilityMandate:
      description: Protected mandate identified in a membership-removal conflict.
      properties:
        ikaros_ref_no:
          description: External mandate reference, when available.
          maxLength: 50
          type: string
        uuid:
          description: Stable identifier of the protected mandate.
          format: uuid
          type: string
      required:
        - ikaros_ref_no
        - uuid
      type: object
    MembershipResponsibilityReplacement:
      description: Active company user eligible to receive protected work.
      properties:
        email:
          description: Email address of the eligible user.
          maxLength: 254
          type: string
        first_name:
          description: Given name of the eligible user.
          maxLength: 150
          type: string
        initials:
          description: Initials displayed for the eligible user.
          maxLength: 6
          type: string
        last_name:
          description: Family name of the eligible user.
          maxLength: 150
          type: string
        uuid:
          description: Stable identifier of the eligible user.
          format: uuid
          type: string
      required:
        - email
        - first_name
        - initials
        - last_name
        - uuid
      type: object
    MembershipResponsibilityOrder:
      description: Pending order identified in a membership-removal conflict.
      properties:
        uuid:
          description: Stable identifier of the pending order.
          format: uuid
          type: string
      required:
        - uuid
      type: object
  securitySchemes:
    partnerBearerAuth:
      description: >-
        Partner API Bearer key: `Authorization: Bearer <key>`. Keys are created
        only through authorized portal or staff flows.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.