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

# Remove Service (IDP) ⚡

> Delete a service from the API server.
A service can be deleted with an organization token or by a user with the MODIFY_SERVICE role.

This endpoint is hosted on the Authlete IdP server (`https://login.authlete.com`),
not on the regional API clusters.




## OpenAPI

````yaml https://spec.speakeasy.com/authlete/sdk-workspace/authlete-api-explorer-with-code-samples post /api/service/remove
openapi: 3.0.3
info:
  title: Authlete API
  description: ''
  version: 3.0.16
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
servers:
  - description: 🇺🇸 US Cluster
    url: https://us.authlete.com
  - description: 🇯🇵 Japan Cluster
    url: https://jp.authlete.com
  - description: 🇪🇺 Europe Cluster
    url: https://eu.authlete.com
  - description: 🇧🇷 Brazil Cluster
    url: https://br.authlete.com
security:
  - bearer: []
tags:
  - name: Service Management
    description: >-
      API endpoints for managing services, including creation, update, and
      deletion of services.
    x-tag-expanded: false
  - name: Client Management
    description: >-
      API endpoints for managing OAuth clients, including creation, update, and
      deletion of clients.
    x-tag-expanded: false
  - name: Authorization Endpoint
    description: API endpoints for implementing OAuth 2.0 Authorization Endpoint.
    x-tag-expanded: false
  - name: Pushed Authorization Endpoint
    description: >-
      API endpoints for implementing OAuth 2.0 Pushed Authorization Requests
      (PAR).
    x-tag-expanded: false
  - name: Token Endpoint
    description: API endpoints for implementing OAuth 2.0 Token Endpoint.
    x-tag-expanded: false
  - name: Token Operations
    description: >-
      API endpoints for various token related operations, including creating,
      revoking and deleting access_tokens with specified scopes.
    x-tag-expanded: false
  - name: Introspection Endpoint
    description: API endpoints for implementing OAuth 2.0 Introspection Endpoint.
    x-tag-expanded: false
  - name: Revocation Endpoint
    description: API endpoint for implementing OAuth 2.0 Revocation Endpoint.
    x-tag-expanded: false
  - name: UserInfo Endpoint
    description: API endpoints for implementing OpenID Connect UserInfo Endpoint.
    x-tag-expanded: false
  - name: JWK Set Endpoint
    description: API endpoints for to generate JSON Web Key Set (JWKS) for a service.
    x-tag-expanded: false
  - name: Discovery Endpoint
    description: API endpoints for implementing OpenID Connect Discovery.
    x-tag-expanded: false
  - name: Configuration Endpoint
    description: API endpoint for accessing configuration settings for a service.
    x-tag-expanded: false
  - name: Dynamic Client Registration
    description: API endpoints for implementing OAuth 2.0 Dynamic Client Registration.
    x-tag-expanded: false
  - name: CIBA
    description: >-
      API endpoints for implementing Client-Initiated Backchannel Authentication
      (CIBA).
    x-tag-expanded: false
  - name: Grant Management Endpoint
    description: >-
      API endpoint for implementing OAuth 2.0 grants, including grant management
      actions like updating and revoking grants.
    x-tag-expanded: false
  - name: Jose Object
    description: API endpoints for JOSE objects.
    x-tag-expanded: false
  - name: Device Flow
    description: API endpoints for implementing OAuth 2.0 Device Flow
    x-tag-expanded: false
  - name: Federation Endpoint
    description: API endpoints for implementing OpenID Federation using Authlete.
    x-tag-expanded: false
  - name: Verifiable Credential Issuer
    description: >-
      API endpoints for implementing and running a Verifiable Credential Issuer
      (VCI).
    x-tag-expanded: false
  - name: Hardware Security Key
    description: API endpoints for managing hardware security keys (HSK).
    x-tag-expanded: false
  - name: Utility Endpoints
    description: API endpoints for various utility operations.
    x-tag-expanded: false
  - name: Native SSO
    description: API endpoints for Native SSO
    x-tag-expanded: false
  - name: Audit Logs
    description: >-
      API endpoints for retrieving audit logs, hosted on the Authlete IdP
      server.
    x-tag-expanded: false
paths:
  /api/service/remove:
    servers:
      - url: https://login.authlete.com
        description: IDP Server
        x-speakeasy-server-id: idp
    post:
      tags:
        - Service Management
      summary: Remove Service (IDP) ⚡
      description: >
        Delete a service from the API server.

        A service can be deleted with an organization token or by a user with
        the MODIFY_SERVICE role.


        This endpoint is hosted on the Authlete IdP server
        (`https://login.authlete.com`),

        not on the regional API clusters.
      operationId: service_remove_idp_api
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/service_remove_idp_request'
            example:
              apiServerId: 76281
              organizationId: 123456789012345
              serviceId: 21653835348762
      responses:
        '204':
          description: Service removed successfully.
        '400':
          $ref: '#/components/responses/idp_400'
        '401':
          $ref: '#/components/responses/idp_401'
        '403':
          $ref: '#/components/responses/idp_403'
        '500':
          $ref: '#/components/responses/idp_500'
      x-codeSamples:
        - lang: typescript
          label: Typescript (SDK)
          source: |-
            import { Authlete } from "@authlete/typescript-sdk";

            const authlete = new Authlete({
              bearer: process.env["AUTHLETE_BEARER"] ?? "",
            });

            async function run() {
              await authlete.service.remove({
                apiServerId: 76281,
                organizationId: 123456789012345,
                serviceId: 21653835348762,
              });


            }

            run();
      x-code-samples:
        - lang: shell
          label: curl
          source: >
            curl -v -X POST https://login.authlete.com/api/service/remove \

            -H 'Content-Type:application/json' \

            -H 'Authorization: Bearer <organization-token>' \

            -d '{ "apiServerId": 76281, "organizationId": 123456789012345,
            "serviceId": 21653835348762 }'
components:
  schemas:
    service_remove_idp_request:
      type: object
      required:
        - organizationId
        - serviceId
      properties:
        apiServerId:
          type: integer
          format: int64
          description: >
            The numeric ID of the API server the service belongs to. Official
            SDKs inject

            this automatically for known Authlete clusters, so it can be omitted
            there;

            all other callers must provide it.
        organizationId:
          type: integer
          format: int64
          description: The numeric ID of the organization the service belongs to.
        serviceId:
          type: integer
          format: int64
          description: The numeric ID of the service to delete.
    idp_error:
      type: object
      description: >
        Error response returned by the Authlete IdP server. Unlike the main
        API's

        `resultCode`/`resultMessage` format, IdP errors carry a human-readable
        `error` message,

        optionally accompanied by contextual fields (such as `organizationId` or
        `apiServerId`).

        Request validation failures instead return an `errors` array of
        per-field messages.
      properties:
        error:
          type: string
          description: A human-readable error message.
        errors:
          type: array
          items:
            type: string
          description: >-
            Per-field validation error messages, present for request validation
            failures.
      additionalProperties: true
  responses:
    idp_400:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/idp_error'
          example:
            error: Unknown user or invalid access token
    idp_401:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/idp_error'
    idp_403:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/idp_error'
          example:
            error: No access to organization for this user
    idp_500:
      description: ''
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/idp_error'
          example:
            error: An internal error occurred. Please try again later.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        Authenticate every request with a **Service Access Token** or
        **Organization Token**.

        Set the token value in the `Authorization: Bearer <token>` header.


        **Service Access Token**: Scoped to a single service. Use when
        automating service-level configuration or runtime flows.


        **Organization Token**: Scoped to the organization; inherits permissions
        across services. Use for org-wide automation or when managing multiple
        services programmatically.


        Both token types are issued by the Authlete console or provisioning
        APIs.

````