Skip to content
Start here

Revoke Certificate

client.OriginCACertificates.Delete(ctx, certificateID) (*OriginCACertificateDeleteResponse, error)
DELETE/certificates/{certificate_id}

Revoke an existing Origin CA certificate by its serial number. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint (see above).

Security
User Service Key

Used when interacting with the Origin CA certificates API. View/change your key.

Example:X-Auth-User-Service-Key: v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
ParametersExpand Collapse
certificateID string

Identifier.

maxLength32
ReturnsExpand Collapse
type OriginCACertificateDeleteResponse struct{…}
ID stringoptional

Identifier.

maxLength32
RevokedAt Timeoptional

When the certificate was revoked.

formatdate-time

Revoke Certificate

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
)

func main() {
  client := cloudflare.NewClient(
    option.WithUserServiceKey("v1.0-144c9defac04969c7bfad8ef-631a41d003a32d25fe878081ef365c49503f7fada600da935e2851a1c7326084b85cbf6429c4b859de8475731dc92a9c329631e6d59e6c73da7b198497172b4cefe071d90d0f5d2719"),
  )
  originCACertificate, err := client.OriginCACertificates.Delete(context.TODO(), "023e105f4ecef8ad9ca31a8372d0c353")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", originCACertificate.ID)
}
{
  "result": {
    "id": "023e105f4ecef8ad9ca31a8372d0c353",
    "revoked_at": "2024-09-06T18:43:47.928893Z"
  }
}
Returns Examples
{
  "result": {
    "id": "023e105f4ecef8ad9ca31a8372d0c353",
    "revoked_at": "2024-09-06T18:43:47.928893Z"
  }
}