# Delete cost line DELETE https://api.trebellar.app/api/v2/costs/line/{id} Reference: https://docs.trebellar.app/api-reference/api-resources/costs/delete-cost-line ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Delete cost line version: endpoint_costs.deleteCostLine paths: /api/v2/costs/line/{id}: delete: operationId: delete-cost-line summary: Delete cost line tags: - - subpackage_costs parameters: - name: id in: path description: >- A unique identifier for an asset. Can be an AssetId or an ExternalId. ExternalIds are denoted by the "eid:" prefix. required: true schema: $ref: '#/components/schemas/GenericId' - name: X-Trebellar-Api-Key in: header required: true schema: type: string responses: '200': description: Costs line deleted successfully content: application/json: schema: $ref: '#/components/schemas/DeleteCostLineResponse' '400': description: Bad request content: {} '500': description: Internal Server Error content: {} components: schemas: GenericId: type: string DeleteCostLineResponseData: type: object properties: {} DeleteCostLineResponse: type: object properties: data: $ref: '#/components/schemas/DeleteCostLineResponseData' required: - data ``` ## SDK Code Examples ```typescript import { TrebellarApiClient } from "@trebellar/api-sdk"; async function main() { const client = new TrebellarApiClient({ environment: "https://api.trebellar.app", }); await client.costs.deleteCostLine("eid:sfo-001"); } main(); ``` ```python from trebellar import TrebellarApi client = TrebellarApi( base_url="https://api.trebellar.app", api_key= ) client.costs.delete_cost_line( id="eid:sfo-001" ) ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.trebellar.app/api/v2/costs/line/eid%3Asfo-001" req, _ := http.NewRequest("DELETE", url, nil) req.Header.Add("X-Trebellar-Api-Key", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.trebellar.app/api/v2/costs/line/eid%3Asfo-001") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Delete.new(url) request["X-Trebellar-Api-Key"] = '' response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.delete("https://api.trebellar.app/api/v2/costs/line/eid%3Asfo-001") .header("X-Trebellar-Api-Key", "") .asString(); ``` ```php request('DELETE', 'https://api.trebellar.app/api/v2/costs/line/eid%3Asfo-001', [ 'headers' => [ 'X-Trebellar-Api-Key' => '', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.trebellar.app/api/v2/costs/line/eid%3Asfo-001"); var request = new RestRequest(Method.DELETE); request.AddHeader("X-Trebellar-Api-Key", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["X-Trebellar-Api-Key": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.trebellar.app/api/v2/costs/line/eid%3Asfo-001")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "DELETE" request.allHTTPHeaderFields = headers 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() ```