> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://apidocs.polytomic.com/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://apidocs.polytomic.com/_mcp/server. # Remove User DELETE https://app.polytomic.com/api/organizations/{org_id}/users/{id} Deletes a user from the specified organization. > 🚧 Requires partner key > > User endpoints are only accessible using [partner keys](../../../../../guides/obtaining-api-keys#partner-keys). Reference: https://apidocs.polytomic.com/api-reference/users/delete ## Authentication - `Authorization` header (basic auth, required) — This is the Polytomic deployment key (on-premises only) - `Authorization` header (bearer token, required) — This is the Polytomic API key ## Request ### Path parameters - `id` (string, required) — Unique identifier of the user. - `org_id` (string, required) — Unique identifier of the organization the user belongs to. ## Response ### 200 OK - `data` (V2User, optional) ## Errors ### 401 Unauthorized Error Unauthorized - `code` (integer, optional) — Application-specific error code. - `context` (map from string to any, optional) — Application context. - `error` (string, optional) — Error message. - `status` (string, optional) — Status text. ### 403 Forbidden Error Forbidden - `key` (string, optional) - `message` (string, optional) - `metadata` (map from string to any, optional) - `status` (integer, optional) ### 404 Not Found Error Not Found - `key` (string, optional) - `message` (string, optional) - `metadata` (map from string to any, optional) - `status` (integer, optional) ### 500 Internal Server Error Internal Server Error - `key` (string, optional) - `message` (string, optional) - `metadata` (map from string to any, optional) - `status` (integer, optional) ## Types ### V2User - `email` (string, optional) — Email address used to sign in and receive notifications. - `id` (string, optional) — Unique identifier of the user. - `organization_id` (string, optional) — Unique identifier of the organization the user belongs to. - `role_ids` (list of string, optional, nullable) — Identifiers of the permissions roles assigned to the user. - `role` (string, optional, deprecated) — Deprecated legacy role name. Use role_ids instead. ## Examples **Request** ```json {} ``` **Response** ```json { "data": { "email": "jane.doe@polytomic.com", "id": "a3f1c9d2-4b7e-4f8a-9c2d-1e5b7f9a1234", "organization_id": "b7e2d4f9-3c6a-4d8b-9f1a-2c3d4e5f6789", "role_ids": [ "d9f8a7b6-c5e4-4d3f-9a1b-2c3d4e5f6789" ], "role": "admin" } } ``` **SDK Code** ```typescript import { PolytomicClient } from "polytomic"; async function main() { const client = new PolytomicClient({ token: "YOUR_TOKEN_HERE", version: "X-Polytomic-Version", }); await client.users.delete("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d"); } main(); ``` ```python from polytomic import Polytomic client = Polytomic( token="YOUR_TOKEN_HERE", version="X-Polytomic-Version", ) client.users.delete( org_id="248df4b7-aa70-47b8-a036-33ac447e668d", id="248df4b7-aa70-47b8-a036-33ac447e668d", ) ``` ```go package example import ( context "context" client "github.com/polytomic/polytomic-go/v24/client" option "github.com/polytomic/polytomic-go/v24/option" ) func do() { client := client.NewClient( option.WithToken( "YOUR_TOKEN_HERE", ), option.WithVersion( "X-Polytomic-Version", ), ) client.Users.Delete( context.TODO(), "248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", ) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://app.polytomic.com/api/organizations/248df4b7-aa70-47b8-a036-33ac447e668d/users/248df4b7-aa70-47b8-a036-33ac447e668d") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) request["X-Polytomic-Version"] = 'X-Polytomic-Version' request.basic_auth("", "") request["Content-Type"] = 'application/json' request.body = "{}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.delete("https://app.polytomic.com/api/organizations/248df4b7-aa70-47b8-a036-33ac447e668d/users/248df4b7-aa70-47b8-a036-33ac447e668d") .header("X-Polytomic-Version", "X-Polytomic-Version") .basicAuth("", "") .header("Content-Type", "application/json") .body("{}") .asString(); ``` ```php request('DELETE', 'https://app.polytomic.com/api/organizations/248df4b7-aa70-47b8-a036-33ac447e668d/users/248df4b7-aa70-47b8-a036-33ac447e668d', [ 'body' => '{}', 'headers' => [ 'Content-Type' => 'application/json', 'X-Polytomic-Version' => 'X-Polytomic-Version', ], 'auth' => ['', ''], ]); echo $response->getBody(); ``` ```csharp using RestSharp; using RestSharp.Authenticators; var client = new RestClient("https://app.polytomic.com/api/organizations/248df4b7-aa70-47b8-a036-33ac447e668d/users/248df4b7-aa70-47b8-a036-33ac447e668d"); client.Authenticator = new HttpBasicAuthenticator("", ""); var request = new RestRequest(Method.DELETE); request.AddHeader("X-Polytomic-Version", "X-Polytomic-Version"); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let credentials = Data(":".utf8).base64EncodedString() let headers = [ "X-Polytomic-Version": "X-Polytomic-Version", "Authorization": "Basic \(credentials)", "Content-Type": "application/json" ] let parameters = [] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://app.polytomic.com/api/organizations/248df4b7-aa70-47b8-a036-33ac447e668d/users/248df4b7-aa70-47b8-a036-33ac447e668d")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "DELETE" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```