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();require 'uri'
require 'net/http'
url = URI("https://login.authlete.com/api/service/remove")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"apiServerId\": 76281,\n \"organizationId\": 123456789012345,\n \"serviceId\": 21653835348762\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://login.authlete.com/api/service/remove"
payload := strings.NewReader("{\n \"apiServerId\": 76281,\n \"organizationId\": 123456789012345,\n \"serviceId\": 21653835348762\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request POST \
--url https://login.authlete.com/api/service/remove \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"apiServerId": 76281,
"organizationId": 123456789012345,
"serviceId": 21653835348762
}
'{
"error": "Unknown user or invalid access token"
}{
"error": "<string>",
"errors": [
"<string>"
]
}{
"error": "No access to organization for this user"
}{
"error": "An internal error occurred. Please try again later."
}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.
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();require 'uri'
require 'net/http'
url = URI("https://login.authlete.com/api/service/remove")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"apiServerId\": 76281,\n \"organizationId\": 123456789012345,\n \"serviceId\": 21653835348762\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://login.authlete.com/api/service/remove"
payload := strings.NewReader("{\n \"apiServerId\": 76281,\n \"organizationId\": 123456789012345,\n \"serviceId\": 21653835348762\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}curl --request POST \
--url https://login.authlete.com/api/service/remove \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"apiServerId": 76281,
"organizationId": 123456789012345,
"serviceId": 21653835348762
}
'{
"error": "Unknown user or invalid access token"
}{
"error": "<string>",
"errors": [
"<string>"
]
}{
"error": "No access to organization for this user"
}{
"error": "An internal error occurred. Please try again later."
}Authorizations
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.
Body
The numeric ID of the organization the service belongs to.
The numeric ID of the service to delete.
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.
Response
Service removed successfully.