JSON. To receive XML, set the Accept header to application/xml.
        POST https://api.myshiptracking.com/api/v2/fleets/delete
        | Parameter | Required | Type | Default | Description | 
|---|---|---|---|---|
| apikey (header) | yes | text | 
                            Your API key. Pass it via the HTTP header 
                            Authorization: Bearer YOUR_API_KEY or x-api-key.
                         | 
                    |
| fleet_id | yes | integer | The unique identifier for the fleet to be deleted. | |
| secret | yes | string | Your secret (generated when your API key was created) used to authorize this deletion. | 
| Field | Type | Description | 
|---|---|---|
| status | text | Indicates the outcome of the request. Expected value: deleted on success. | 
                    
All API responses follow a standardized envelope format for consistency and ease of integration.
On success (HTTP status code 200), the envelope includes:
status: "success"duration: Time taken to process the request (in seconds).timestamp: Server timestamp when the response was generated (ISO 8601 format).data: An object containing the outcome. For this endpoint, it includes:
                status: "deleted"On error, the envelope includes:
status: "error"duration: Time taken to process the request.timestamp: Server timestamp when the error was generated.code: Specific error code for troubleshooting.message: Detailed error message.The response format (JSON or XML) is determined by the Accept header.
Note: When a request error occurs (such as providing an invalid secret or if the fleet is not found), no deletion is performed.
{
    "status": "success",
    "duration": "0.648492515",
    "timestamp": "2025-11-04T14:42:38.969Z",
    "data": {
        "status": "deleted"
    }
}
        
        {
    "status": "error",
    "duration": "0.001714728",
    "timestamp": "2025-11-04T14:42:31.240Z",
    "code": "ERR_INVALID_SECRET",
    "message": "Invalid secret."
}
    The following error responses may be returned. Each error follows the standardized response envelope.
| Error Code | HTTP Status | Description | 
|---|---|---|
| ERR_NO_KEY | 401 | No API key was provided in the request headers. | 
| ERR_INVALID_KEY | 401 | The provided API key is invalid or unrecognized. | 
| ERR_INVALID_SECRET | 401 | The provided secret is invalid or unrecognized. | 
| ERR_NOACCESS | 403 | The API key does not have permission to access this endpoint. | 
| ERR_FLEET_NOT_FOUND | 404 | The specified fleet was not found or is not owned by the user. | 
| ERR_INTERNAL | 500 | An internal server error occurred. | 
<?php
$apiKey = "YOUR_API_KEY";
$fleet_id = "282767";
$secret = "DoTMbVoI8";
$url = "https://api.myshiptracking.com/api/v2/fleets/delete";
$data = [
    "fleet_id" => $fleet_id,
    "secret"   => $secret
];
$headers = [
    "Authorization: Bearer $apiKey",
    "Content-Type: application/json"
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
if(curl_errno($ch)) {
    echo 'Request Error: ' . curl_error($ch);
} else {
    echo $response;
}
curl_close($ch);
?>
                curl --location 'https://api.myshiptracking.com/api/v2/fleets/delete' \
--header 'authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
    "fleet_id": "282767",
    "secret": "DoTMbVoI8"
}'
                import requests
import json
api_key = "YOUR_API_KEY"
fleet_id = "282767"
secret   = "DoTMbVoI8"
url      = f"https://api.myshiptracking.com/api/v2/fleets/delete"
headers = {
    "Authorization": f"Bearer {api_key}",
    "Content-Type": "application/json"
}
data = {
    "fleet_id": fleet_id,
    "secret": secret
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
                const apiKey = "YOUR_API_KEY";
const fleet_id = "282767";
const secret = "DoTMbVoI8";
const url = `https://api.myshiptracking.com/api/v2/fleets/delete`;
fetch(url, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({ fleet_id, secret })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error("Error:", error));
                import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
public class FleetDeletionExample {
    public static void main(String[] args) {
        try {
            String apiKey = "YOUR_API_KEY";
            String fleet_id = "282767";
            String secret = "DoTMbVoI8";
            String urlString = "https://api.myshiptracking.com/api/v2/fleets/delete";
            URL url = new URL(urlString);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("POST");
            conn.setRequestProperty("Authorization", "Bearer " + apiKey);
            conn.setRequestProperty("Content-Type", "application/json");
            conn.setDoOutput(true);
            String jsonInputString = "{\"fleet_id\": \"" + fleet_id + "\", \"secret\": \"" + secret + "\"}";
            try(OutputStream os = conn.getOutputStream()) {
                byte[] input = jsonInputString.getBytes("utf-8");
                os.write(input, 0, input.length);
            }
            int responseCode = conn.getResponseCode();
            BufferedReader in = new BufferedReader(new InputStreamReader(
                (responseCode == HttpURLConnection.HTTP_OK) ? conn.getInputStream() : conn.getErrorStream()));
            StringBuilder response = new StringBuilder();
            String responseLine;
            while ((responseLine = in.readLine()) != null) {
                response.append(responseLine.trim());
            }
            in.close();
            System.out.println(response.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
                using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
class FleetDeletionExample {
    static async Task Main() {
        string apiKey = "YOUR_API_KEY";
        string fleet_id = "282767";
        string secret = "DoTMbVoI8";
        string url = "https://api.myshiptracking.com/api/v2/fleets/delete";
        using (HttpClient client = new HttpClient()) {
            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
            client.DefaultRequestHeaders.Add("Content-Type", "application/json");
            var json = $"{{\"fleet_id\":\"{fleet_id}\", \"secret\":\"{secret}\"}}";
            var content = new StringContent(json, Encoding.UTF8, "application/json");
            HttpResponseMessage response = await client.PostAsync(url, content);
            string result = await response.Content.ReadAsStringAsync();
            Console.WriteLine(result);
        }
    }
}
                require 'net/http'
require 'uri'
require 'json'
api_key = "YOUR_API_KEY"
fleet_id = "282767"
secret   = "DoTMbVoI8"
uri = URI("https://api.myshiptracking.com/api/v2/fleets/delete")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.request_uri, {
  'Authorization' => "Bearer #{api_key}",
  'Content-Type' => 'application/json'
})
request.body = { fleet_id: fleet_id, secret: secret }.to_json
response = http.request(request)
puts response.body
                
Your request preview will appear here...
                
            
Your response will appear here...