ASNs can only be deleted if they are in “cancelled” status or created in error. Received ASNs cannot be deleted for audit trail purposes.
Path Parameters
The unique identifier of the ASN to delete
Response
The ID of the deleted ASN
Always true for successful deletion
curl --location --request DELETE 'https://api.stateset.com/v1/asns/asn_0901f083-aa1c-43c5-af5c-0a9d2fc64e30' \
--header 'Authorization: Bearer YOUR_API_KEY'
{
"id" : "asn_0901f083-aa1c-43c5-af5c-0a9d2fc64e30" ,
"object" : "asn" ,
"deleted" : true
}
Error Responses
Error object when deletion fails Show Error object properties
Type of error (e.g., “invalid_request”, “asn_received”)
Human-readable error message
Error code for programmatic handling
{
"error" : {
"type" : "asn_received" ,
"message" : "Cannot delete ASN that has been received. ASNs with received status must be maintained for audit purposes." ,
"code" : "ASN_ALREADY_RECEIVED"
}
}