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

# Archive a role with an explicit replacement



## OpenAPI

````yaml https://api.tembo.io/public-api/openapi/public delete /v1/organizations/{organizationId}/roles/{roleId}
openapi: 3.1.0
info:
  title: Tembo Public API
  description: >-
    Manage agents, sessions, repositories, and organization resources with the
    Tembo API.
  version: 1.0.0
servers:
  - url: https://api.tembo.io
    description: Tembo API
  - url: https://{deployment-origin}/api/public-api
    description: Self-hosted Tembo
    variables:
      deployment-origin:
        default: tembo.example.com
        description: Hostname of your self-hosted Tembo deployment
security: []
paths:
  /v1/organizations/{organizationId}/roles/{roleId}:
    delete:
      tags:
        - Organization roles
      summary: Archive a role with an explicit replacement
      operationId: deleteOrganizationRole
      parameters:
        - in: path
          name: organizationId
          schema:
            type: string
          required: true
        - schema:
            type: string
          in: path
          name: roleId
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                replacementRoleId:
                  type: string
                  minLength: 1
              required:
                - replacementRoleId
              additionalProperties: false
      responses:
        '200':
          description: Archive a role with an explicit replacement
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                required:
                  - id
        '400':
          description: Role validation, authorization, not-found, or conflict error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  permission:
                    type: string
                required:
                  - error
        '403':
          description: Role validation, authorization, not-found, or conflict error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  permission:
                    type: string
                required:
                  - error
        '404':
          description: Role validation, authorization, not-found, or conflict error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  permission:
                    type: string
                required:
                  - error
        '409':
          description: Role validation, authorization, not-found, or conflict error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  permission:
                    type: string
                required:
                  - error
      security:
        - apiKey: []
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: |
            import Tembo from '@tembo-io/sdk';

            const client = new Tembo();

            const role = await client.organizations.roles.delete('roleId', {
              organizationId: 'organizationId',
              replacementRoleId: 'x',
            });
        - lang: rust
          label: Rust SDK
          source: |
            use tembo_rs::*;

            let client = Tembo::from_env()?;

            let response = client
                .organizations()
                .roles()
                .delete("example", "example", RolesDeleteBody::new("x".to_string()))
                .send()
                .await?;
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer

````

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